Images for Carl

Mariah A. Knowles
May, 3rd 2021

Setup

Imports

using EpistemicNetworkAnalysis
using GLM

Global Config

# Data
data = ena_dataset("shakespeare.data")

# Config
codes = [
    :Love,
    #:Beauty,
    :Death,
    #:Fear,
    #:Friendship,
    #:Hate,
    :Honor,
    :Men,
    :Women,
    #:Pride
]

conversations = [:Play, :Act]
units = [:Play, :Act, :Speaker]
dropEmpty=true
sphereNormalize=true
extraColors = [
        EpistemicNetworkAnalysis.DEFAULT_NEG_COLOR,
        EpistemicNetworkAnalysis.DEFAULT_POS_COLOR,
        EpistemicNetworkAnalysis.DEFAULT_EXTRA_COLORS...
]

Analysis (Hamlet vs. RJ)

SVD

Note that (a,f) the groups overlap, but (f) there are some differences.

let # create a non-global scope

rotation = SVDRotation()
ena = ENAModel(data, codes, conversations, units, dropEmpty=dropEmpty, sphereNormalize=sphereNormalize, rotateBy=rotation)
p = plot(ena, groupBy=:Play, extraColors=extraColors)
display(p)
display(ena)

end # let
Units (centroids):
105×13 DataFrame. Omitted printing of 10 columns
│ Row │ ENA_UNIT                           │ pos_x       │ pos_y       │
│     │ String                             │ Float64     │ Float64     │
├─────┼────────────────────────────────────┼─────────────┼─────────────┤
│ 1   │ Hamlet.1.BERNARDO                  │ -0.64166    │ -0.0547483  │
│ 2   │ Hamlet.1.HORATIO                   │ -0.403599   │ -0.0973322  │
│ 3   │ Hamlet.1.MARCELLUS                 │ -0.511805   │ -0.168013   │
│ 4   │ Hamlet.1.KING CLAUDIUS             │ -0.169272   │ -0.223691   │
│ 5   │ Hamlet.1.LAERTES                   │ 0.476418    │ 0.0534875   │
│ 6   │ Hamlet.1.LORD POLONIUS             │ 0.455798    │ 0.100253    │
│ 7   │ Hamlet.1.HAMLET                    │ -0.318004   │ -0.122185   │
│ 8   │ Hamlet.1.QUEEN GERTRUDE            │ -0.621148   │ -0.00404228 │
│ 9   │ Hamlet.1.All                       │ 0.295554    │ -0.383389   │
│ 10  │ Hamlet.1.OPHELIA                   │ 0.487379    │ -0.136244   │
│ 11  │ Hamlet.1.Ghost                     │ 0.00845416  │ 0.0365347   │
│ 12  │ Hamlet.2.LORD POLONIUS             │ 0.147293    │ -0.42442    │
│ 13  │ Hamlet.2.OPHELIA                   │ 0.264969    │ -0.488384   │
│ 14  │ Hamlet.2.KING CLAUDIUS             │ 0.31823     │ -0.248204   │
│ 15  │ Hamlet.2.QUEEN GERTRUDE            │ -0.261743   │ -0.363424   │
│ 16  │ Hamlet.2.ROSENCRANTZ               │ 0.277291    │ 0.182432    │
│ 17  │ Hamlet.2.GUILDENSTERN              │ 0.0744729   │ -0.452637   │
│ 18  │ Hamlet.2.HAMLET                    │ 0.333423    │ -0.086784   │
│ 19  │ Hamlet.2.First Player              │ 0.0193397   │ 0.0845115   │
│ 20  │ Hamlet.3.KING CLAUDIUS             │ -0.144224   │ 0.261119    │
│ 21  │ Hamlet.3.ROSENCRANTZ               │ 0.0486245   │ -0.474338   │
│ 22  │ Hamlet.3.GUILDENSTERN              │ 0.370873    │ 0.0714189   │
│ 23  │ Hamlet.3.QUEEN GERTRUDE            │ 0.323651    │ -0.323495   │
│ 24  │ Hamlet.3.LORD POLONIUS             │ 0.330603    │ 0.252654    │
│ 25  │ Hamlet.3.OPHELIA                   │ 0.0148982   │ -0.0672402  │
│ 26  │ Hamlet.3.HAMLET                    │ 0.306046    │ -0.0746932  │
│ 27  │ Hamlet.3.First Player              │ 0.197964    │ -0.258991   │
│ 28  │ Hamlet.3.HORATIO                   │ -0.299717   │ -0.0510121  │
│ 29  │ Hamlet.3.Player King               │ 0.414806    │ -0.36946    │
│ 30  │ Hamlet.3.Player Queen              │ 0.559489    │ -0.0241194  │
│ 31  │ Hamlet.4.KING CLAUDIUS             │ -0.0805199  │ -0.0190008  │
│ 32  │ Hamlet.4.QUEEN GERTRUDE            │ 0.083993    │ 0.592976    │
│ 33  │ Hamlet.4.HAMLET                    │ -0.685332   │ 0.0528171   │
│ 34  │ Hamlet.4.ROSENCRANTZ               │ -0.478395   │ -0.292199   │
│ 35  │ Hamlet.4.PRINCE FORTINBRAS         │ -0.0613496  │ -0.0638115  │
│ 36  │ Hamlet.4.Captain                   │ -0.299717   │ -0.0510121  │
│ 37  │ Hamlet.4.Gentleman                 │ -0.621148   │ -0.00404228 │
│ 38  │ Hamlet.4.HORATIO                   │ -0.621148   │ -0.00404228 │
│ 39  │ Hamlet.4.OPHELIA                   │ -0.21518    │ -0.0324831  │
│ 40  │ Hamlet.4.LAERTES                   │ -0.292335   │ -0.0316747  │
│ 41  │ Hamlet.4.Servant                   │ -0.621148   │ -0.00404228 │
│ 42  │ Hamlet.4.Messenger                 │ 0.58799     │ -0.00597854 │
│ 43  │ Hamlet.5.First Clown               │ -0.558328   │ 0.166776    │
│ 44  │ Hamlet.5.HAMLET                    │ 0.0210134   │ -0.0185903  │
│ 45  │ Hamlet.5.HORATIO                   │ 0.140473    │ -0.0657693  │
│ 46  │ Hamlet.5.LAERTES                   │ 0.421233    │ -0.0412879  │
│ 47  │ Hamlet.5.First Priest              │ -0.164714   │ 0.659672    │
│ 48  │ Hamlet.5.QUEEN GERTRUDE            │ 0.0717617   │ 0.754235    │
│ 49  │ Hamlet.5.KING CLAUDIUS             │ -0.576333   │ -0.199968   │
│ 50  │ Hamlet.5.OSRIC                     │ 0.264969    │ -0.488384   │
│ 51  │ Hamlet.5.Lord                      │ 0.280183    │ 0.428511    │
│ 52  │ Hamlet.5.PRINCE FORTINBRAS         │ -0.621148   │ -0.00404228 │
│ 53  │ Romeo and Juliet.1.RICHMOND        │ -0.179928   │ -0.257223   │
│ 54  │ Romeo and Juliet.1.SAMPSON         │ 0.280183    │ 0.428511    │
│ 55  │ Romeo and Juliet.1.BENVOLIO        │ 0.226656    │ 0.0656387   │
│ 56  │ Romeo and Juliet.1.TYBALT          │ -0.231253   │ 0.0796132   │
│ 57  │ Romeo and Juliet.1.CAPULET         │ 0.59085     │ 0.0787588   │
│ 58  │ Romeo and Juliet.1.LADY CAPULET    │ 0.749126    │ -0.0741517  │
│ 59  │ Romeo and Juliet.1.ROMEO           │ 0.492456    │ -0.132321   │
│ 60  │ Romeo and Juliet.1.PARIS           │ -0.117107   │ -0.0389732  │
│ 61  │ Romeo and Juliet.1.Servant         │ 0.698341    │ 0.411754    │
│ 62  │ Romeo and Juliet.1.Nurse           │ 0.793665    │ 0.296864    │
│ 63  │ Romeo and Juliet.1.JULIET          │ 0.264969    │ -0.488384   │
│ 64  │ Romeo and Juliet.1.MERCUTIO        │ 0.37918     │ -0.16798    │
│ 65  │ Romeo and Juliet.1.Second Servant  │ 0.264969    │ -0.488384   │
│ 66  │ Romeo and Juliet.1.Second Capulet  │ 0.280183    │ 0.428511    │
│ 67  │ Romeo and Juliet.2.Chorus          │ -0.179928   │ -0.257223   │
│ 68  │ Romeo and Juliet.2.ROMEO           │ 0.343329    │ -0.0457198  │
│ 69  │ Romeo and Juliet.2.BENVOLIO        │ 0.448128    │ -0.356159   │
│ 70  │ Romeo and Juliet.2.MERCUTIO        │ 0.40891     │ 0.281702    │
│ 71  │ Romeo and Juliet.2.JULIET          │ 0.274571    │ -0.339512   │
│ 72  │ Romeo and Juliet.2.Nurse           │ 0.42501     │ 0.348419    │
│ 73  │ Romeo and Juliet.2.FRIAR LAURENCE  │ 0.0845107   │ 0.149654    │
│ 74  │ Romeo and Juliet.2.PETER           │ 0.264969    │ -0.488384   │
│ 75  │ Romeo and Juliet.2.NURSE           │ 0.280183    │ 0.428511    │
│ 76  │ Romeo and Juliet.3.BENVOLIO        │ -0.621148   │ -0.00404228 │
│ 77  │ Romeo and Juliet.3.MERCUTIO        │ -0.261743   │ -0.363424   │
│ 78  │ Romeo and Juliet.3.TYBALT          │ -0.261743   │ -0.363424   │
│ 79  │ Romeo and Juliet.3.ROMEO           │ -0.00183873 │ -0.219765   │
│ 80  │ Romeo and Juliet.3.LADY CAPULET    │ 0.0135253   │ 0.342166    │
│ 81  │ Romeo and Juliet.3.JULIET          │ 0.0450594   │ 0.0576671   │
│ 82  │ Romeo and Juliet.3.Nurse           │ 0.0224297   │ 0.250042    │
│ 83  │ Romeo and Juliet.3.FRIAR LAURENCE  │ -0.18197    │ -0.0413461  │
│ 84  │ Romeo and Juliet.3.CAPULET         │ -0.114447   │ 0.383989    │
│ 85  │ Romeo and Juliet.3.PARIS           │ 0.123822    │ -0.254156   │
│ 86  │ Romeo and Juliet.4.FRIAR LAURENCE  │ -0.0233257  │ 0.196731    │
│ 87  │ Romeo and Juliet.4.PARIS           │ 0.364895    │ 0.0800164   │
│ 88  │ Romeo and Juliet.4.JULIET          │ 0.0338424   │ -0.0966568  │
│ 89  │ Romeo and Juliet.4.CAPULET         │ -0.12236    │ -0.155677   │
│ 90  │ Romeo and Juliet.4.Second Servant  │ 0.264969    │ -0.488384   │
│ 91  │ Romeo and Juliet.4.Nurse           │ -0.138619   │ 0.120928    │
│ 92  │ Romeo and Juliet.4.LADY CAPULET    │ -0.565575   │ 0.448374    │
│ 93  │ Romeo and Juliet.5.ROMEO           │ -0.215653   │ -0.0280108  │
│ 94  │ Romeo and Juliet.5.BALTHASAR       │ -0.294773   │ -0.0692217  │
│ 95  │ Romeo and Juliet.5.Apothecary      │ -0.621148   │ -0.00404228 │
│ 96  │ Romeo and Juliet.5.FRIAR LAURENCE  │ -0.410758   │ 0.558697    │
│ 97  │ Romeo and Juliet.5.PARIS           │ -0.487556   │ -0.330962   │
│ 98  │ Romeo and Juliet.5.PAGE            │ 0.202173    │ 0.319384    │
│ 99  │ Romeo and Juliet.5.JULIET          │ -0.203306   │ 0.186886    │
│ 100 │ Romeo and Juliet.5.First Watchman  │ -0.409595   │ -0.0403663  │
│ 101 │ Romeo and Juliet.5.Second Watchman │ -0.621148   │ -0.00404228 │
│ 102 │ Romeo and Juliet.5.PRINCE          │ -0.214217   │ 0.310984    │
│ 103 │ Romeo and Juliet.5.CAPULET         │ 0.259298    │ 0.761869    │
│ 104 │ Romeo and Juliet.5.LADY CAPULET    │ -0.565575   │ 0.448374    │
│ 105 │ Romeo and Juliet.5.MONTAGUE        │ -0.164714   │ 0.659672    │
Codes:
5×14 DataFrame. Omitted printing of 8 columns
│ Row │ code   │ density  │ pos_x    │ pos_y      │ Death_Honor  │ Death_Me
n │
│     │ Symbol │ Float64  │ Float64  │ Float64    │ Real         │ Real    
  │
├─────┼────────┼──────────┼──────────┼────────────┼──────────────┼─────────
──┤
│ 1   │ Love   │ 0.686152 │ 0.682321 │ -0.778324  │ -0.0232083   │ -0.45978
2 │
│ 2   │ Death  │ 0.6511   │ -1.08991 │ 0.19036    │ 0.0724987    │ 0.950183
  │
│ 3   │ Honor  │ 0.1786   │ -0.13895 │ -0.0619725 │ 0.196636     │ 0.049665
9 │
│ 4   │ Men    │ 1.0      │ -0.20012 │ -0.271963  │ -0.0255981   │ 0.659951
  │
│ 5   │ Women  │ 0.595926 │ 0.712748 │ 1.05547    │ -0.000533696 │ -0.51017
2 │
Network:
10×6 DataFrame. Omitted printing of 1 columns
│ Row │ relationship │ response │ referent │ density   │ weight_x    │
│     │ Symbol       │ Int64    │ Int64    │ Float64   │ Float64     │
├─────┼──────────────┼──────────┼──────────┼───────────┼─────────────┤
│ 1   │ Love_Death   │ 1        │ 2        │ 0.456959  │ 0.0376315   │
│ 2   │ Love_Honor   │ 1        │ 3        │ 0.158203  │ 0.100846    │
│ 3   │ Death_Men    │ 2        │ 4        │ 1.0       │ -0.830602   │
│ 4   │ Men_Women    │ 4        │ 5        │ 0.785616  │ 0.344966    │
│ 5   │ Love_Women   │ 1        │ 5        │ 0.451214  │ 0.226457    │
│ 6   │ Love_Men     │ 1        │ 4        │ 0.97818   │ 0.334342    │
│ 7   │ Death_Women  │ 2        │ 5        │ 0.431999  │ -0.00269219 │
│ 8   │ Honor_Men    │ 3        │ 4        │ 0.215949  │ 0.106658    │
│ 9   │ Death_Honor  │ 2        │ 3        │ 0.0511535 │ 0.00676609  │
│ 10  │ Honor_Women  │ 3        │ 5        │ 0.106877  │ 0.070831    │
coregistration_y:
0.9278695160125693

variance_x:
0.3016013790464127

variance_y:
0.19364529443874579

correlation_y:
0.9292058300591834

coregistration_x:
0.9385217939712907

correlation_x:
0.9384811240980141

MR1

Note that (a,f) that the groups don't overlap now. Men+Death goes towards Hamlet and Women+Love+Death goes towards RJ.

let # create a non-global scope

rotation = MeansRotation(:Play, "Hamlet", "Romeo and Juliet")
ena = ENAModel(data, codes, conversations, units, dropEmpty=dropEmpty, sphereNormalize=sphereNormalize, rotateBy=rotation)
p = plot(ena)
display(p)
display(ena)

end # let
Units (centroids):
105×13 DataFrame. Omitted printing of 10 columns
│ Row │ ENA_UNIT                           │ pos_x       │ pos_y       │
│     │ String                             │ Float64     │ Float64     │
├─────┼────────────────────────────────────┼─────────────┼─────────────┤
│ 1   │ Hamlet.1.BERNARDO                  │ -0.490072   │ 0.504093    │
│ 2   │ Hamlet.1.HORATIO                   │ -0.410456   │ 0.272746    │
│ 3   │ Hamlet.1.MARCELLUS                 │ -0.332897   │ 0.402018    │
│ 4   │ Hamlet.1.KING CLAUDIUS             │ 0.120973    │ 0.199568    │
│ 5   │ Hamlet.1.LAERTES                   │ 0.0892018   │ -0.449522   │
│ 6   │ Hamlet.1.LORD POLONIUS             │ -0.287705   │ -0.550482   │
│ 7   │ Hamlet.1.HAMLET                    │ -0.224924   │ 0.260351    │
│ 8   │ Hamlet.1.QUEEN GERTRUDE            │ -0.303339   │ 0.543284    │
│ 9   │ Hamlet.1.All                       │ 0.0378152   │ -0.316375   │
│ 10  │ Hamlet.1.OPHELIA                   │ -0.270081   │ -0.601545   │
│ 11  │ Hamlet.1.Ghost                     │ 0.403762    │ 0.136579    │
│ 12  │ Hamlet.2.LORD POLONIUS             │ -0.320385   │ -0.301952   │
│ 13  │ Hamlet.2.OPHELIA                   │ -0.127372   │ -0.384023   │
│ 14  │ Hamlet.2.KING CLAUDIUS             │ -0.0643459  │ -0.35982    │
│ 15  │ Hamlet.2.QUEEN GERTRUDE            │ -0.312136   │ 0.125204    │
│ 16  │ Hamlet.2.ROSENCRANTZ               │ -0.281502   │ -0.379451   │
│ 17  │ Hamlet.2.GUILDENSTERN              │ -0.539163   │ -0.302254   │
│ 18  │ Hamlet.2.HAMLET                    │ -0.0056925  │ -0.363939   │
│ 19  │ Hamlet.2.First Player              │ 0.0837278   │ 0.0268849   │
│ 20  │ Hamlet.3.KING CLAUDIUS             │ -0.0408769  │ 0.157972    │
│ 21  │ Hamlet.3.ROSENCRANTZ               │ -0.221606   │ -0.184463   │
│ 22  │ Hamlet.3.GUILDENSTERN              │ -0.119626   │ -0.441006   │
│ 23  │ Hamlet.3.QUEEN GERTRUDE            │ -0.40045    │ -0.494489   │
│ 24  │ Hamlet.3.LORD POLONIUS             │ -0.00470567 │ -0.338139   │
│ 25  │ Hamlet.3.OPHELIA                   │ -0.449699   │ -0.173537   │
│ 26  │ Hamlet.3.HAMLET                    │ 0.0852377   │ -0.304431   │
│ 27  │ Hamlet.3.First Player              │ -0.478729   │ -0.367304   │
│ 28  │ Hamlet.3.HORATIO                   │ -0.331811   │ 0.188421    │
│ 29  │ Hamlet.3.Player King               │ 0.0754442   │ -0.431407   │
│ 30  │ Hamlet.3.Player Queen              │ 0.425089    │ -0.430287   │
│ 31  │ Hamlet.4.KING CLAUDIUS             │ 0.214928    │ 0.158372    │
│ 32  │ Hamlet.4.QUEEN GERTRUDE            │ 0.328741    │ 0.0783444   │
│ 33  │ Hamlet.4.HAMLET                    │ -0.449617   │ 0.578344    │
│ 34  │ Hamlet.4.ROSENCRANTZ               │ -0.251701   │ 0.385527    │
│ 35  │ Hamlet.4.PRINCE FORTINBRAS         │ -0.291135   │ -0.0521554  │
│ 36  │ Hamlet.4.Captain                   │ -0.331811   │ 0.188421    │
│ 37  │ Hamlet.4.Gentleman                 │ -0.303339   │ 0.543284    │
│ 38  │ Hamlet.4.HORATIO                   │ -0.303339   │ 0.543284    │
│ 39  │ Hamlet.4.OPHELIA                   │ 0.271836    │ 0.320694    │
│ 40  │ Hamlet.4.LAERTES                   │ 0.0554714   │ 0.325113    │
│ 41  │ Hamlet.4.Servant                   │ -0.303339   │ 0.543284    │
│ 42  │ Hamlet.4.Messenger                 │ 0.0732747   │ -0.608935   │
│ 43  │ Hamlet.5.First Clown               │ -0.257721   │ 0.509942    │
│ 44  │ Hamlet.5.HAMLET                    │ -0.0417767  │ -0.0401775  │
│ 45  │ Hamlet.5.HORATIO                   │ -0.231793   │ -0.246748   │
│ 46  │ Hamlet.5.LAERTES                   │ 0.147303    │ -0.377591   │
│ 47  │ Hamlet.5.First Priest              │ 0.435897    │ 0.384029    │
│ 48  │ Hamlet.5.QUEEN GERTRUDE            │ 0.265042    │ 0.0803967   │
│ 49  │ Hamlet.5.KING CLAUDIUS             │ 0.0316968   │ 0.600497    │
│ 50  │ Hamlet.5.OSRIC                     │ -0.127372   │ -0.384023   │
│ 51  │ Hamlet.5.Lord                      │ -0.0503558  │ -0.288136   │
│ 52  │ Hamlet.5.PRINCE FORTINBRAS         │ -0.303339   │ 0.543284    │
│ 53  │ Romeo and Juliet.1.RICHMOND        │ 0.35888     │ 0.288142    │
│ 54  │ Romeo and Juliet.1.SAMPSON         │ -0.0503558  │ -0.288136   │
│ 55  │ Romeo and Juliet.1.BENVOLIO        │ 0.541947    │ -0.0441376  │
│ 56  │ Romeo and Juliet.1.TYBALT          │ -0.135316   │ 0.246166    │
│ 57  │ Romeo and Juliet.1.CAPULET         │ -0.0860787  │ -0.636801   │
│ 58  │ Romeo and Juliet.1.LADY CAPULET    │ 0.272224    │ -0.675681   │
│ 59  │ Romeo and Juliet.1.ROMEO           │ 0.293333    │ -0.437047   │
│ 60  │ Romeo and Juliet.1.PARIS           │ -0.442454   │ 0.00616321  │
│ 61  │ Romeo and Juliet.1.Servant         │ 0.389469    │ -0.575308   │
│ 62  │ Romeo and Juliet.1.Nurse           │ 0.374927    │ -0.671353   │
│ 63  │ Romeo and Juliet.1.JULIET          │ -0.127372   │ -0.384023   │
│ 64  │ Romeo and Juliet.1.MERCUTIO        │ 0.571494    │ -0.219416   │
│ 65  │ Romeo and Juliet.1.Second Servant  │ -0.127372   │ -0.384023   │
│ 66  │ Romeo and Juliet.1.Second Capulet  │ -0.0503558  │ -0.288136   │
│ 67  │ Romeo and Juliet.2.Chorus          │ 0.35888     │ 0.288142    │
│ 68  │ Romeo and Juliet.2.ROMEO           │ 0.402955    │ -0.229318   │
│ 69  │ Romeo and Juliet.2.BENVOLIO        │ 0.47353     │ -0.346768   │
│ 70  │ Romeo and Juliet.2.MERCUTIO        │ 0.327203    │ -0.296771   │
│ 71  │ Romeo and Juliet.2.JULIET          │ 0.355837    │ -0.193503   │
│ 72  │ Romeo and Juliet.2.Nurse           │ 0.172219    │ -0.365939   │
│ 73  │ Romeo and Juliet.2.FRIAR LAURENCE  │ 0.332302    │ 0.0398057   │
│ 74  │ Romeo and Juliet.2.PETER           │ -0.127372   │ -0.384023   │
│ 75  │ Romeo and Juliet.2.NURSE           │ -0.0503558  │ -0.288136   │
│ 76  │ Romeo and Juliet.3.BENVOLIO        │ -0.303339   │ 0.543284    │
│ 77  │ Romeo and Juliet.3.MERCUTIO        │ -0.312136   │ 0.125204    │
│ 78  │ Romeo and Juliet.3.TYBALT          │ -0.312136   │ 0.125204    │
│ 79  │ Romeo and Juliet.3.ROMEO           │ 0.409887    │ 0.13161     │
│ 80  │ Romeo and Juliet.3.LADY CAPULET    │ 0.429435    │ 0.168542    │
│ 81  │ Romeo and Juliet.3.JULIET          │ 0.254567    │ 0.0543927   │
│ 82  │ Romeo and Juliet.3.Nurse           │ 0.0807337   │ 0.0276748   │
│ 83  │ Romeo and Juliet.3.FRIAR LAURENCE  │ -0.0518978  │ 0.174969    │
│ 84  │ Romeo and Juliet.3.CAPULET         │ 0.188008    │ 0.228399    │
│ 85  │ Romeo and Juliet.3.PARIS           │ -0.125094   │ -0.207042   │
│ 86  │ Romeo and Juliet.4.FRIAR LAURENCE  │ 0.254048    │ 0.145253    │
│ 87  │ Romeo and Juliet.4.PARIS           │ 0.449557    │ -0.223545   │
│ 88  │ Romeo and Juliet.4.JULIET          │ 0.163339    │ 0.0370304   │
│ 89  │ Romeo and Juliet.4.CAPULET         │ 0.248541    │ 0.202047    │
│ 90  │ Romeo and Juliet.4.Second Servant  │ -0.127372   │ -0.384023   │
│ 91  │ Romeo and Juliet.4.Nurse           │ 0.183023    │ 0.221627    │
│ 92  │ Romeo and Juliet.4.LADY CAPULET    │ 0.0861558   │ 0.668299    │
│ 93  │ Romeo and Juliet.5.ROMEO           │ 0.020565    │ 0.230844    │
│ 94  │ Romeo and Juliet.5.BALTHASAR       │ -0.228669   │ 0.219981    │
│ 95  │ Romeo and Juliet.5.Apothecary      │ -0.303339   │ 0.543284    │
│ 96  │ Romeo and Juliet.5.FRIAR LAURENCE  │ 0.184219    │ 0.550517    │
│ 97  │ Romeo and Juliet.5.PARIS           │ -0.164741   │ 0.423686    │
│ 98  │ Romeo and Juliet.5.PAGE            │ 0.135663    │ -0.144101   │
│ 99  │ Romeo and Juliet.5.JULIET          │ 0.341656    │ 0.35407     │
│ 100 │ Romeo and Juliet.5.First Watchman  │ -0.337252   │ 0.304182    │
│ 101 │ Romeo and Juliet.5.Second Watchman │ -0.303339   │ 0.543284    │
│ 102 │ Romeo and Juliet.5.PRINCE          │ 0.134907    │ 0.30198     │
│ 103 │ Romeo and Juliet.5.CAPULET         │ 0.573564    │ -0.00662517 │
│ 104 │ Romeo and Juliet.5.LADY CAPULET    │ 0.0861558   │ 0.668299    │
│ 105 │ Romeo and Juliet.5.MONTAGUE        │ 0.435897    │ 0.384029    │
Codes:
5×14 DataFrame. Omitted printing of 8 columns
│ Row │ code   │ density  │ pos_x     │ pos_y      │ Death_Honor  │ Death_M
en │
│     │ Symbol │ Float64  │ Float64   │ Float64    │ Real         │ Real   
   │
├─────┼────────┼──────────┼───────────┼────────────┼──────────────┼────────
───┤
│ 1   │ Love   │ 0.686152 │ 0.516555  │ -0.608771  │ -0.0232083   │ -0.4597
82 │
│ 2   │ Death  │ 0.6511   │ 0.164622  │ 1.24584    │ 0.0724987    │ 0.95018
3  │
│ 3   │ Honor  │ 0.1786   │ -0.477508 │ 0.0368093  │ 0.196636     │ 0.04966
59 │
│ 4   │ Men    │ 1.0      │ -0.807883 │ -0.0984861 │ -0.0255981   │ 0.65995
1  │
│ 5   │ Women  │ 0.595926 │ 0.670589  │ -0.416996  │ -0.000533696 │ -0.5101
72 │
Network:
10×6 DataFrame. Omitted printing of 1 columns
│ Row │ relationship │ response │ referent │ density   │ weight_x    │
│     │ Symbol       │ Int64    │ Int64    │ Float64   │ Float64     │
├─────┼──────────────┼──────────┼──────────┼───────────┼─────────────┤
│ 1   │ Love_Death   │ 1        │ 2        │ 0.456959  │ 0.53968     │
│ 2   │ Love_Honor   │ 1        │ 3        │ 0.158203  │ -0.173948   │
│ 3   │ Death_Men    │ 2        │ 4        │ 1.0       │ -0.421155   │
│ 4   │ Men_Women    │ 4        │ 5        │ 0.785616  │ -0.00452653 │
│ 5   │ Love_Women   │ 1        │ 5        │ 0.451214  │ 0.361796    │
│ 6   │ Love_Men     │ 1        │ 4        │ 0.97818   │ -0.139863   │
│ 7   │ Death_Women  │ 2        │ 5        │ 0.431999  │ 0.466471    │
│ 8   │ Honor_Men    │ 3        │ 4        │ 0.215949  │ -0.359599   │
│ 9   │ Death_Honor  │ 2        │ 3        │ 0.0511535 │ 0.0584121   │
│ 10  │ Honor_Women  │ 3        │ 5        │ 0.106877  │ -0.0178756  │
coregistration_y:
0.9512184751903435

variance_x:
0.17230801193560522

variance_y:
0.2843435580542175

correlation_y:
0.9519072175392032

coregistration_x:
0.9584815684351075

correlation_x:
0.9622175015268307

LDA (no subspace adjustment)

Y-axis is MR of remaining variance.

Note (a,f) that groups are pulled apart on both X and Y axes, but (a) the variance explained on X is 3% and the coregistration along X is about 87%. The difference seems to be Men vs. Women.

let # create a non-global scope

rotation = LDARotation(:Play)
ena = ENAModel(data, codes, conversations, units, dropEmpty=dropEmpty, sphereNormalize=sphereNormalize, rotateBy=rotation)
p = plot(ena, extraColors=extraColors)
display(p)
display(ena)

end # let
Units (centroids):
105×13 DataFrame. Omitted printing of 10 columns
│ Row │ ENA_UNIT                           │ pos_x       │ pos_y       │
│     │ String                             │ Float64     │ Float64     │
├─────┼────────────────────────────────────┼─────────────┼─────────────┤
│ 1   │ Hamlet.1.BERNARDO                  │ -0.13564    │ -0.486171   │
│ 2   │ Hamlet.1.HORATIO                   │ -0.154633   │ -0.384037   │
│ 3   │ Hamlet.1.MARCELLUS                 │ -0.0773202  │ -0.338609   │
│ 4   │ Hamlet.1.KING CLAUDIUS             │ 0.0308752   │ 0.121482    │
│ 5   │ Hamlet.1.LAERTES                   │ -0.02937    │ 0.118996    │
│ 6   │ Hamlet.1.LORD POLONIUS             │ -0.172771   │ -0.232858   │
│ 7   │ Hamlet.1.HAMLET                    │ -0.127771   │ -0.186164   │
│ 8   │ Hamlet.1.QUEEN GERTRUDE            │ -0.0417279  │ -0.324753   │
│ 9   │ Hamlet.1.All                       │ 0.0754761   │ 0.000831096 │
│ 10  │ Hamlet.1.OPHELIA                   │ -0.165523   │ -0.216711   │
│ 11  │ Hamlet.1.Ghost                     │ 0.128086    │ 0.391331    │
│ 12  │ Hamlet.2.LORD POLONIUS             │ -0.150723   │ -0.282822   │
│ 13  │ Hamlet.2.OPHELIA                   │ -0.00471122 │ -0.143593   │
│ 14  │ Hamlet.2.KING CLAUDIUS             │ -0.10092    │ -0.0169369  │
│ 15  │ Hamlet.2.QUEEN GERTRUDE            │ -0.0895082  │ -0.307893   │
│ 16  │ Hamlet.2.ROSENCRANTZ               │ -0.115832   │ -0.257864   │
│ 17  │ Hamlet.2.GUILDENSTERN              │ -0.193741   │ -0.509754   │
│ 18  │ Hamlet.2.HAMLET                    │ -0.0508933  │ 0.0221814   │
│ 19  │ Hamlet.2.First Player              │ -0.0288106  │ 0.112395    │
│ 20  │ Hamlet.3.KING CLAUDIUS             │ -0.0329085  │ -0.0283662  │
│ 21  │ Hamlet.3.ROSENCRANTZ               │ -0.0539089  │ -0.224033   │
│ 22  │ Hamlet.3.GUILDENSTERN              │ -0.0444362  │ -0.112283   │
│ 23  │ Hamlet.3.QUEEN GERTRUDE            │ -0.189336   │ -0.352967   │
│ 24  │ Hamlet.3.LORD POLONIUS             │ -0.0217838  │ 0.00688883  │
│ 25  │ Hamlet.3.OPHELIA                   │ -0.210004   │ -0.397854   │
│ 26  │ Hamlet.3.HAMLET                    │ -0.0146502  │ 0.106138    │
│ 27  │ Hamlet.3.First Player              │ -0.202622   │ -0.435351   │
│ 28  │ Hamlet.3.HORATIO                   │ -0.117156   │ -0.314884   │
│ 29  │ Hamlet.3.Player King               │ -0.0200194  │ 0.0979226   │
│ 30  │ Hamlet.3.Player Queen              │ 0.108747    │ 0.426732    │
│ 31  │ Hamlet.4.KING CLAUDIUS             │ 0.0507046   │ 0.218173    │
│ 32  │ Hamlet.4.QUEEN GERTRUDE            │ 0.108417    │ 0.316289    │
│ 33  │ Hamlet.4.HAMLET                    │ -0.135415   │ -0.439847   │
│ 34  │ Hamlet.4.ROSENCRANTZ               │ -0.0620156  │ -0.254014   │
│ 35  │ Hamlet.4.PRINCE FORTINBRAS         │ -0.119272   │ -0.266984   │
│ 36  │ Hamlet.4.Captain                   │ -0.117156   │ -0.314884   │
│ 37  │ Hamlet.4.Gentleman                 │ -0.0417279  │ -0.324753   │
│ 38  │ Hamlet.4.HORATIO                   │ -0.0417279  │ -0.324753   │
│ 39  │ Hamlet.4.OPHELIA                   │ 0.0951018   │ 0.258463    │
│ 40  │ Hamlet.4.LAERTES                   │ 0.00414181  │ 0.0613561   │
│ 41  │ Hamlet.4.Servant                   │ -0.0417279  │ -0.324753   │
│ 42  │ Hamlet.4.Messenger                 │ 0.0071818   │ 0.0800827   │
│ 43  │ Hamlet.5.First Clown               │ -0.0523361  │ -0.266388   │
│ 44  │ Hamlet.5.HAMLET                    │ -0.0582649  │ -0.0150915  │
│ 45  │ Hamlet.5.HORATIO                   │ -0.0993743  │ -0.210074   │
│ 46  │ Hamlet.5.LAERTES                   │ -0.00347572 │ 0.171097    │
│ 47  │ Hamlet.5.First Priest              │ 0.240924    │ 0.364558    │
│ 48  │ Hamlet.5.QUEEN GERTRUDE            │ 0.123113    │ 0.234857    │
│ 49  │ Hamlet.5.KING CLAUDIUS             │ 0.0714255   │ -0.00390857 │
│ 50  │ Hamlet.5.OSRIC                     │ -0.00471122 │ -0.143593   │
│ 51  │ Hamlet.5.Lord                      │ 0.0133291   │ -0.0653405  │
│ 52  │ Hamlet.5.PRINCE FORTINBRAS         │ -0.0417279  │ -0.324753   │
│ 53  │ Romeo and Juliet.1.RICHMOND        │ 0.222883    │ 0.286306    │
│ 54  │ Romeo and Juliet.1.SAMPSON         │ 0.0133291   │ -0.0653405  │
│ 55  │ Romeo and Juliet.1.BENVOLIO        │ 0.180176    │ 0.520604    │
│ 56  │ Romeo and Juliet.1.TYBALT          │ -0.123959   │ -0.0854256  │
│ 57  │ Romeo and Juliet.1.CAPULET         │ -0.0918898  │ -0.0469863  │
│ 58  │ Romeo and Juliet.1.LADY CAPULET    │ 0.0725739   │ 0.27162     │
│ 59  │ Romeo and Juliet.1.ROMEO           │ 0.0781649   │ 0.292703    │
│ 60  │ Romeo and Juliet.1.PARIS           │ -0.230755   │ -0.377824   │
│ 61  │ Romeo and Juliet.1.Servant         │ 0.149288    │ 0.362956    │
│ 62  │ Romeo and Juliet.1.Nurse           │ 0.11324     │ 0.366599    │
│ 63  │ Romeo and Juliet.1.JULIET          │ -0.00471122 │ -0.143593   │
│ 64  │ Romeo and Juliet.1.MERCUTIO        │ 0.213209    │ 0.535891    │
│ 65  │ Romeo and Juliet.1.Second Servant  │ -0.00471122 │ -0.143593   │
│ 66  │ Romeo and Juliet.1.Second Capulet  │ 0.0133291   │ -0.0653405  │
│ 67  │ Romeo and Juliet.2.Chorus          │ 0.222883    │ 0.286306    │
│ 68  │ Romeo and Juliet.2.ROMEO           │ 0.117832    │ 0.39619     │
│ 69  │ Romeo and Juliet.2.BENVOLIO        │ 0.186275    │ 0.438606    │
│ 70  │ Romeo and Juliet.2.MERCUTIO        │ 0.0790518   │ 0.331093    │
│ 71  │ Romeo and Juliet.2.JULIET          │ 0.113691    │ 0.344425    │
│ 72  │ Romeo and Juliet.2.Nurse           │ 0.043355    │ 0.173281    │
│ 73  │ Romeo and Juliet.2.FRIAR LAURENCE  │ 0.0936085   │ 0.328734    │
│ 74  │ Romeo and Juliet.2.PETER           │ -0.00471122 │ -0.143593   │
│ 75  │ Romeo and Juliet.2.NURSE           │ 0.0133291   │ -0.0653405  │
│ 76  │ Romeo and Juliet.3.BENVOLIO        │ -0.0417279  │ -0.324753   │
│ 77  │ Romeo and Juliet.3.MERCUTIO        │ -0.0895082  │ -0.307893   │
│ 78  │ Romeo and Juliet.3.TYBALT          │ -0.0895082  │ -0.307893   │
│ 79  │ Romeo and Juliet.3.ROMEO           │ 0.143966    │ 0.389403    │
│ 80  │ Romeo and Juliet.3.LADY CAPULET    │ 0.1341      │ 0.417415    │
│ 81  │ Romeo and Juliet.3.JULIET          │ 0.0421731   │ 0.268501    │
│ 82  │ Romeo and Juliet.3.Nurse           │ -0.013083   │ 0.100082    │
│ 83  │ Romeo and Juliet.3.FRIAR LAURENCE  │ -0.0620498  │ -0.024577   │
│ 84  │ Romeo and Juliet.3.CAPULET         │ 0.0282281   │ 0.199946    │
│ 85  │ Romeo and Juliet.3.PARIS           │ -0.0604557  │ -0.109521   │
│ 86  │ Romeo and Juliet.4.FRIAR LAURENCE  │ 0.0372884   │ 0.270661    │
│ 87  │ Romeo and Juliet.4.PARIS           │ 0.128487    │ 0.443688    │
│ 88  │ Romeo and Juliet.4.JULIET          │ -0.0101137  │ 0.193255    │
│ 89  │ Romeo and Juliet.4.CAPULET         │ 0.0786355   │ 0.241007    │
│ 90  │ Romeo and Juliet.4.Second Servant  │ -0.00471122 │ -0.143593   │
│ 91  │ Romeo and Juliet.4.Nurse           │ 0.0398827   │ 0.187645    │
│ 92  │ Romeo and Juliet.4.LADY CAPULET    │ 0.084182    │ 0.0514241   │
│ 93  │ Romeo and Juliet.5.ROMEO           │ -0.0133927  │ 0.0311701   │
│ 94  │ Romeo and Juliet.5.BALTHASAR       │ -0.0921868  │ -0.210543   │
│ 95  │ Romeo and Juliet.5.Apothecary      │ -0.0417279  │ -0.324753   │
│ 96  │ Romeo and Juliet.5.FRIAR LAURENCE  │ 0.0856762   │ 0.163179    │
│ 97  │ Romeo and Juliet.5.PARIS           │ -0.0316054  │ -0.171325   │
│ 98  │ Romeo and Juliet.5.PAGE            │ 0.0439171   │ 0.13099     │
│ 99  │ Romeo and Juliet.5.JULIET          │ 0.110835    │ 0.329755    │
│ 100 │ Romeo and Juliet.5.First Watchman  │ -0.104587   │ -0.328222   │
│ 101 │ Romeo and Juliet.5.Second Watchman │ -0.0417279  │ -0.324753   │
│ 102 │ Romeo and Juliet.5.PRINCE          │ 0.0275345   │ 0.139366    │
│ 103 │ Romeo and Juliet.5.CAPULET         │ 0.22902     │ 0.529347    │
│ 104 │ Romeo and Juliet.5.LADY CAPULET    │ 0.084182    │ 0.0514241   │
│ 105 │ Romeo and Juliet.5.MONTAGUE        │ 0.240924    │ 0.364558    │
Codes:
5×14 DataFrame. Omitted printing of 8 columns
│ Row │ code   │ density  │ pos_x     │ pos_y     │ Death_Honor  │ Death_Me
n │
│     │ Symbol │ Float64  │ Float64   │ Float64   │ Real         │ Real    
  │
├─────┼────────┼──────────┼───────────┼───────────┼──────────────┼─────────
──┤
│ 1   │ Love   │ 0.686152 │ 0.123085  │ 0.523664  │ -0.0232083   │ -0.45978
2 │
│ 2   │ Death  │ 0.6511   │ 0.0490514 │ 0.161343  │ 0.0724987    │ 0.950183
  │
│ 3   │ Honor  │ 0.1786   │ -0.245763 │ -0.409606 │ 0.196636     │ 0.049665
9 │
│ 4   │ Men    │ 1.0      │ -0.406138 │ -0.698453 │ -0.0255981   │ 0.659951
  │
│ 5   │ Women  │ 0.595926 │ 0.159165  │ 0.680169  │ -0.000533696 │ -0.51017
2 │
Network:
10×6 DataFrame
│ Row │ relationship │ response │ referent │ density   │ weight_x  │ weight
_y  │
│     │ Symbol       │ Int64    │ Int64    │ Float64   │ Float64   │ Float6
4   │
├─────┼──────────────┼──────────┼──────────┼───────────┼───────────┼───────
────┤
│ 1   │ Love_Death   │ 1        │ 2        │ 0.456959  │ 0.119978  │ 0.5519
69  │
│ 2   │ Love_Honor   │ 1        │ 3        │ 0.158203  │ -0.373978 │ 0.0112
951 │
│ 3   │ Death_Men    │ 2        │ 4        │ 1.0       │ -0.206643 │ -0.366
975 │
│ 4   │ Men_Women    │ 4        │ 5        │ 0.785616  │ -0.105214 │ 0.0541
715 │
│ 5   │ Love_Women   │ 1        │ 5        │ 0.451214  │ 0.080219  │ 0.3701
55  │
│ 6   │ Love_Men     │ 1        │ 4        │ 0.97818   │ -0.107891 │ -0.099
713 │
│ 7   │ Death_Women  │ 2        │ 5        │ 0.431999  │ 0.0608494 │ 0.5012
74  │
│ 8   │ Honor_Men    │ 3        │ 4        │ 0.215949  │ -0.475362 │ -0.144
664 │
│ 9   │ Death_Honor  │ 2        │ 3        │ 0.0511535 │ 0.638471  │ -0.293
201 │
│ 10  │ Honor_Women  │ 3        │ 5        │ 0.106877  │ 0.369569  │ -0.229
062 │
signal_to_noise_ratio:
0.28518484251734894

coregistration_y:
0.945384669841477

variance_x:
0.027840856489736752

variance_y:
0.162951181667554

correlation_y:
0.9490832353008137

coregistration_x:
0.826762305535127

correlation_x:
0.8491429214801888

LDA (with subspace adjustment)

X-axis is LDA within subspace of first 4 SVD dimensions. Y-axis is MR of remaining variance within that subspace.

Note (a) the variance explained is now 16%, the coregistration is now 95%, and (a,f) the difference is now no longer just Men vs. Women, but love+death+women vs men+honor.

let # create a non-global scope

rotation = LDARotation(:Play)
ena = ENAModel(data, codes, conversations, units, dropEmpty=dropEmpty, sphereNormalize=sphereNormalize, rotateBy=rotation, subspace=4)
p = plot(ena, extraColors=extraColors)
display(p)
display(ena)

end # let
Units (centroids):
105×13 DataFrame. Omitted printing of 10 columns
│ Row │ ENA_UNIT                           │ pos_x       │ pos_y       │
│     │ String                             │ Float64     │ Float64     │
├─────┼────────────────────────────────────┼─────────────┼─────────────┤
│ 1   │ Hamlet.1.BERNARDO                  │ 0.409983    │ -0.344201   │
│ 2   │ Hamlet.1.HORATIO                   │ 0.345185    │ -0.228546   │
│ 3   │ Hamlet.1.MARCELLUS                 │ 0.237765    │ -0.397185   │
│ 4   │ Hamlet.1.KING CLAUDIUS             │ -0.187009   │ -0.116769   │
│ 5   │ Hamlet.1.LAERTES                   │ 0.0204599   │ 0.461917    │
│ 6   │ Hamlet.1.LORD POLONIUS             │ 0.428236    │ 0.494531    │
│ 7   │ Hamlet.1.HAMLET                    │ 0.183736    │ 0.00473748  │
│ 8   │ Hamlet.1.QUEEN GERTRUDE            │ 0.20911     │ -0.426878   │
│ 9   │ Hamlet.1.All                       │ 0.0342234   │ 0.135212    │
│ 10  │ Hamlet.1.OPHELIA                   │ 0.388827    │ 0.429573    │
│ 11  │ Hamlet.1.Ghost                     │ -0.425555   │ 0.066493    │
│ 12  │ Hamlet.2.LORD POLONIUS             │ 0.326929    │ 0.0226686   │
│ 13  │ Hamlet.2.OPHELIA                   │ 0.119141    │ -0.198747   │
│ 14  │ Hamlet.2.KING CLAUDIUS             │ 0.128552    │ 0.364755    │
│ 15  │ Hamlet.2.QUEEN GERTRUDE            │ 0.234782    │ -0.331937   │
│ 16  │ Hamlet.2.ROSENCRANTZ               │ 0.353647    │ 0.118709    │
│ 17  │ Hamlet.2.GUILDENSTERN              │ 0.556257    │ -0.0521478  │
│ 18  │ Hamlet.2.HAMLET                    │ 0.0433588   │ 0.161462    │
│ 19  │ Hamlet.2.First Player              │ -0.0718968  │ 0.197755    │
│ 20  │ Hamlet.3.KING CLAUDIUS             │ 0.0271918   │ -0.0187672  │
│ 21  │ Hamlet.3.ROSENCRANTZ               │ 0.180863    │ -0.252902   │
│ 22  │ Hamlet.3.GUILDENSTERN              │ 0.173745    │ 0.0413595   │
│ 23  │ Hamlet.3.QUEEN GERTRUDE            │ 0.478203    │ 0.248408    │
│ 24  │ Hamlet.3.LORD POLONIUS             │ 0.0636963   │ 0.12991     │
│ 25  │ Hamlet.3.OPHELIA                   │ 0.471325    │ 0.0688014   │
│ 26  │ Hamlet.3.HAMLET                    │ -0.0609142  │ 0.132386    │
│ 27  │ Hamlet.3.First Player              │ 0.581128    │ 0.337914    │
│ 28  │ Hamlet.3.HORATIO                   │ 0.27506     │ -0.237114   │
│ 29  │ Hamlet.3.Player King               │ -0.0196919  │ 0.28217     │
│ 30  │ Hamlet.3.Player Queen              │ -0.329343   │ 0.449085    │
│ 31  │ Hamlet.4.KING CLAUDIUS             │ -0.252405   │ 0.0026632   │
│ 32  │ Hamlet.4.QUEEN GERTRUDE            │ -0.283945   │ 0.192943    │
│ 33  │ Hamlet.4.HAMLET                    │ 0.373685    │ -0.279324   │
│ 34  │ Hamlet.4.ROSENCRANTZ               │ 0.146187    │ -0.37553    │
│ 35  │ Hamlet.4.PRINCE FORTINBRAS         │ 0.267211    │ -0.13237    │
│ 36  │ Hamlet.4.Captain                   │ 0.27506     │ -0.237114   │
│ 37  │ Hamlet.4.Gentleman                 │ 0.20911     │ -0.426878   │
│ 38  │ Hamlet.4.HORATIO                   │ 0.20911     │ -0.426878   │
│ 39  │ Hamlet.4.OPHELIA                   │ -0.329737   │ -0.0692242  │
│ 40  │ Hamlet.4.LAERTES                   │ -0.121787   │ -0.115693   │
│ 41  │ Hamlet.4.Servant                   │ 0.20911     │ -0.426878   │
│ 42  │ Hamlet.4.Messenger                 │ 0.000278224 │ 0.158998    │
│ 43  │ Hamlet.5.First Clown               │ 0.184175    │ -0.311051   │
│ 44  │ Hamlet.5.HAMLET                    │ 0.0308688   │ 0.0346745   │
│ 45  │ Hamlet.5.HORATIO                   │ 0.237693    │ -0.0581857  │
│ 46  │ Hamlet.5.LAERTES                   │ -0.0548549  │ 0.431595    │
│ 47  │ Hamlet.5.First Priest              │ -0.413164   │ -0.00345694 │
│ 48  │ Hamlet.5.QUEEN GERTRUDE            │ -0.200108   │ 0.149203    │
│ 49  │ Hamlet.5.KING CLAUDIUS             │ -0.146739   │ -0.375583   │
│ 50  │ Hamlet.5.OSRIC                     │ 0.119141    │ -0.198747   │
│ 51  │ Hamlet.5.Lord                      │ 0.126388    │ 0.058267    │
│ 52  │ Hamlet.5.PRINCE FORTINBRAS         │ 0.20911     │ -0.426878   │
│ 53  │ Romeo and Juliet.1.RICHMOND        │ -0.420412   │ -0.260471   │
│ 54  │ Romeo and Juliet.1.SAMPSON         │ 0.126388    │ 0.058267    │
│ 55  │ Romeo and Juliet.1.BENVOLIO        │ -0.529918   │ 0.163304    │
│ 56  │ Romeo and Juliet.1.TYBALT          │ 0.174473    │ 0.390626    │
│ 57  │ Romeo and Juliet.1.CAPULET         │ 0.2147      │ 0.436224    │
│ 58  │ Romeo and Juliet.1.LADY CAPULET    │ -0.103691   │ 0.61121     │
│ 59  │ Romeo and Juliet.1.ROMEO           │ -0.253365   │ 0.162265    │
│ 60  │ Romeo and Juliet.1.PARIS           │ 0.508881    │ 0.376824    │
│ 61  │ Romeo and Juliet.1.Servant         │ -0.263725   │ 0.310516    │
│ 62  │ Romeo and Juliet.1.Nurse           │ -0.207093   │ 0.548909    │
│ 63  │ Romeo and Juliet.1.JULIET          │ 0.119141    │ -0.198747   │
│ 64  │ Romeo and Juliet.1.MERCUTIO        │ -0.554717   │ 0.119969    │
│ 65  │ Romeo and Juliet.1.Second Servant  │ 0.119141    │ -0.198747   │
│ 66  │ Romeo and Juliet.1.Second Capulet  │ 0.126388    │ 0.058267    │
│ 67  │ Romeo and Juliet.2.Chorus          │ -0.420412   │ -0.260471   │
│ 68  │ Romeo and Juliet.2.ROMEO           │ -0.381159   │ 0.162347    │
│ 69  │ Romeo and Juliet.2.BENVOLIO        │ -0.459698   │ 0.0597807   │
│ 70  │ Romeo and Juliet.2.MERCUTIO        │ -0.264382   │ 0.263509    │
│ 71  │ Romeo and Juliet.2.JULIET          │ -0.354502   │ 0.105082    │
│ 72  │ Romeo and Juliet.2.Nurse           │ -0.0937959  │ 0.216138    │
│ 73  │ Romeo and Juliet.2.FRIAR LAURENCE  │ -0.331057   │ 0.115654    │
│ 74  │ Romeo and Juliet.2.PETER           │ 0.119141    │ -0.198747   │
│ 75  │ Romeo and Juliet.2.NURSE           │ 0.126388    │ 0.058267    │
│ 76  │ Romeo and Juliet.3.BENVOLIO        │ 0.20911     │ -0.426878   │
│ 77  │ Romeo and Juliet.3.MERCUTIO        │ 0.234782    │ -0.331937   │
│ 78  │ Romeo and Juliet.3.TYBALT          │ 0.234782    │ -0.331937   │
│ 79  │ Romeo and Juliet.3.ROMEO           │ -0.442768   │ 0.0360943   │
│ 80  │ Romeo and Juliet.3.LADY CAPULET    │ -0.423139   │ 0.152164    │
│ 81  │ Romeo and Juliet.3.JULIET          │ -0.253424   │ 0.177841    │
│ 82  │ Romeo and Juliet.3.Nurse           │ -0.0690218  │ 0.125609    │
│ 83  │ Romeo and Juliet.3.FRIAR LAURENCE  │ 0.0144612   │ 0.00018452  │
│ 84  │ Romeo and Juliet.3.CAPULET         │ -0.181753   │ 0.162568    │
│ 85  │ Romeo and Juliet.3.PARIS           │ 0.108206    │ -0.0860491  │
│ 86  │ Romeo and Juliet.4.FRIAR LAURENCE  │ -0.241201   │ 0.2447      │
│ 87  │ Romeo and Juliet.4.PARIS           │ -0.414757   │ 0.219355    │
│ 88  │ Romeo and Juliet.4.JULIET          │ -0.143428   │ 0.310159    │
│ 89  │ Romeo and Juliet.4.CAPULET         │ -0.303873   │ -0.062437   │
│ 90  │ Romeo and Juliet.4.Second Servant  │ 0.119141    │ -0.198747   │
│ 91  │ Romeo and Juliet.4.Nurse           │ -0.215714   │ 0.0110238   │
│ 92  │ Romeo and Juliet.4.LADY CAPULET    │ -0.141615   │ -0.193847   │
│ 93  │ Romeo and Juliet.5.ROMEO           │ -0.0743086  │ -0.0911929  │
│ 94  │ Romeo and Juliet.5.BALTHASAR       │ 0.166607    │ -0.196815   │
│ 95  │ Romeo and Juliet.5.Apothecary      │ 0.20911     │ -0.426878   │
│ 96  │ Romeo and Juliet.5.FRIAR LAURENCE  │ -0.212475   │ -0.0424385  │
│ 97  │ Romeo and Juliet.5.PARIS           │ 0.0518299   │ -0.367238   │
│ 98  │ Romeo and Juliet.5.PAGE            │ -0.0920592  │ 0.112092    │
│ 99  │ Romeo and Juliet.5.JULIET          │ -0.380442   │ 0.017984    │
│ 100 │ Romeo and Juliet.5.First Watchman  │ 0.266453    │ -0.293147   │
│ 101 │ Romeo and Juliet.5.Second Watchman │ 0.20911     │ -0.426878   │
│ 102 │ Romeo and Juliet.5.PRINCE          │ -0.159867   │ 0.0152932   │
│ 103 │ Romeo and Juliet.5.CAPULET         │ -0.487067   │ 0.281469    │
│ 104 │ Romeo and Juliet.5.LADY CAPULET    │ -0.141615   │ -0.193847   │
│ 105 │ Romeo and Juliet.5.MONTAGUE        │ -0.413164   │ -0.00345694 │
Codes:
5×14 DataFrame. Omitted printing of 8 columns
│ Row │ code   │ density  │ pos_x     │ pos_y      │ Death_Honor  │ Death_M
en │
│     │ Symbol │ Float64  │ Float64   │ Float64    │ Real         │ Real   
   │
├─────┼────────┼──────────┼───────────┼────────────┼──────────────┼────────
───┤
│ 1   │ Love   │ 0.686152 │ -0.503926 │ 0.234301   │ -0.0232083   │ -0.4597
82 │
│ 2   │ Death  │ 0.6511   │ -0.323989 │ -0.221962  │ 0.0724987    │ 0.95018
3  │
│ 3   │ Honor  │ 0.1786   │ 0.585281  │ 0.569403   │ 0.196636     │ 0.04966
59 │
│ 4   │ Men    │ 1.0      │ 0.755117  │ -0.0985139 │ -0.0255981   │ 0.65995
1  │
│ 5   │ Women  │ 0.595926 │ -0.489432 │ 0.748328   │ -0.000533696 │ -0.5101
72 │
Network:
10×6 DataFrame
│ Row │ relationship │ response │ referent │ density   │ weight_x  │ weight
_y  │
│     │ Symbol       │ Int64    │ Int64    │ Float64   │ Float64   │ Float6
4   │
├─────┼──────────────┼──────────┼──────────┼───────────┼───────────┼───────
────┤
│ 1   │ Love_Death   │ 1        │ 2        │ 0.456959  │ -0.637511 │ 0.0832
086 │
│ 2   │ Love_Honor   │ 1        │ 3        │ 0.158203  │ 0.254111  │ 0.4469
78  │
│ 3   │ Death_Men    │ 2        │ 4        │ 1.0       │ 0.296785  │ -0.231
428 │
│ 4   │ Men_Women    │ 4        │ 5        │ 0.785616  │ 0.0638644 │ 0.3522
2   │
│ 5   │ Love_Women   │ 1        │ 5        │ 0.451214  │ -0.323907 │ 0.3226
74  │
│ 6   │ Love_Men     │ 1        │ 4        │ 0.97818   │ 0.161275  │ 0.1001
74  │
│ 7   │ Death_Women  │ 2        │ 5        │ 0.431999  │ -0.405428 │ 0.3611
47  │
│ 8   │ Honor_Men    │ 3        │ 4        │ 0.215949  │ 0.314137  │ 0.4090
44  │
│ 9   │ Death_Honor  │ 2        │ 3        │ 0.0511535 │ 0.0904057 │ 0.2669
6   │
│ 10  │ Honor_Women  │ 3        │ 5        │ 0.106877  │ 0.186268  │ 0.3640
13  │
signal_to_noise_ratio:
0.28518484251734894

coregistration_y:
0.9761999874460429

variance_x:
0.15797106866498747

variance_y:
0.13619619048923362

correlation_y:
0.9762420507252969

coregistration_x:
0.9537926837911658

correlation_x:
0.9585270847620141

Code Difference Rotation (Men vs Women)

Note (a,f) the groups are pulled apart when we look at the account of the networks given by Men vs. Women.

let # create a non-global scope

rotation = EpistemicNetworkAnalysis.DifferenceRotation(4, 5)
ena = ENAModel(data, codes, conversations, units, dropEmpty=dropEmpty, sphereNormalize=sphereNormalize, rotateBy=rotation, rotateOn=:codeModel)
p = plot(ena, groupBy=:Play, extraColors=extraColors)
display(p)
display(ena)

end # let
Units (centroids):
105×13 DataFrame. Omitted printing of 10 columns
│ Row │ ENA_UNIT                           │ pos_x      │ pos_y       │
│     │ String                             │ Float64    │ Float64     │
├─────┼────────────────────────────────────┼────────────┼─────────────┤
│ 1   │ Hamlet.1.BERNARDO                  │ 0.417775   │ 0.552267    │
│ 2   │ Hamlet.1.HORATIO                   │ 0.441695   │ 0.198973    │
│ 3   │ Hamlet.1.MARCELLUS                 │ 0.425531   │ 0.311325    │
│ 4   │ Hamlet.1.KING CLAUDIUS             │ 0.177254   │ 0.00495207  │
│ 5   │ Hamlet.1.LAERTES                   │ -0.27706   │ -0.232364   │
│ 6   │ Hamlet.1.LORD POLONIUS             │ -0.1394    │ -0.172485   │
│ 7   │ Hamlet.1.HAMLET                    │ 0.298053   │ 0.240861    │
│ 8   │ Hamlet.1.QUEEN GERTRUDE            │ 0.306622   │ 0.507739    │
│ 9   │ Hamlet.1.All                       │ -0.209568  │ 0.0981829   │
│ 10  │ Hamlet.1.OPHELIA                   │ -0.0126961 │ -0.289823   │
│ 11  │ Hamlet.1.Ghost                     │ -0.181971  │ -0.0161512  │
│ 12  │ Hamlet.2.LORD POLONIUS             │ 0.368373   │ -0.267998   │
│ 13  │ Hamlet.2.OPHELIA                   │ 0.248713   │ -0.416831   │
│ 14  │ Hamlet.2.KING CLAUDIUS             │ 0.0355575  │ -0.208169   │
│ 15  │ Hamlet.2.QUEEN GERTRUDE            │ 0.480232   │ 0.00401306  │
│ 16  │ Hamlet.2.ROSENCRANTZ               │ -0.0163238 │ -0.249179   │
│ 17  │ Hamlet.2.GUILDENSTERN              │ 0.421942   │ -0.110995   │
│ 18  │ Hamlet.2.HAMLET                    │ 0.034685   │ -0.40936    │
│ 19  │ Hamlet.2.First Player              │ -0.045248  │ -0.00594684 │
│ 20  │ Hamlet.3.KING CLAUDIUS             │ 0.00682837 │ 0.0688614   │
│ 21  │ Hamlet.3.ROSENCRANTZ               │ 0.388906   │ -0.273424   │
│ 22  │ Hamlet.3.GUILDENSTERN              │ -0.0251511 │ -0.428872   │
│ 23  │ Hamlet.3.QUEEN GERTRUDE            │ 0.195892   │ -0.21724    │
│ 24  │ Hamlet.3.LORD POLONIUS             │ -0.149981  │ -0.347756   │
│ 25  │ Hamlet.3.OPHELIA                   │ 0.304607   │ -0.0981205  │
│ 26  │ Hamlet.3.HAMLET                    │ 0.00772356 │ -0.406381   │
│ 27  │ Hamlet.3.First Player              │ 0.0879024  │ 0.14139     │
│ 28  │ Hamlet.3.HORATIO                   │ 0.365546   │ 0.0829252   │
│ 29  │ Hamlet.3.Player King               │ -0.0121323 │ -0.321716   │
│ 30  │ Hamlet.3.Player Queen              │ -0.437313  │ -0.299965   │
│ 31  │ Hamlet.4.KING CLAUDIUS             │ 0.00486456 │ -0.0179353  │
│ 32  │ Hamlet.4.QUEEN GERTRUDE            │ -0.481547  │ 0.0688614   │
│ 33  │ Hamlet.4.HAMLET                    │ 0.356013   │ 0.631679    │
│ 34  │ Hamlet.4.ROSENCRANTZ               │ 0.459948   │ 0.241433    │
│ 35  │ Hamlet.4.PRINCE FORTINBRAS         │ 0.30545    │ -0.152133   │
│ 36  │ Hamlet.4.Captain                   │ 0.365546   │ 0.0829252   │
│ 37  │ Hamlet.4.Gentleman                 │ 0.306622   │ 0.507739    │
│ 38  │ Hamlet.4.HORATIO                   │ 0.306622   │ 0.507739    │
│ 39  │ Hamlet.4.OPHELIA                   │ -0.0224321 │ 0.155709    │
│ 40  │ Hamlet.4.LAERTES                   │ 0.152359   │ 0.145705    │
│ 41  │ Hamlet.4.Servant                   │ 0.306622   │ 0.507739    │
│ 42  │ Hamlet.4.Messenger                 │ -0.132148  │ -0.627113   │
│ 43  │ Hamlet.5.First Clown               │ 0.212309   │ 0.462031    │
│ 44  │ Hamlet.5.HAMLET                    │ 0.131675   │ -0.16125    │
│ 45  │ Hamlet.5.HORATIO                   │ 0.212739   │ -0.318923   │
│ 46  │ Hamlet.5.LAERTES                   │ -0.255132  │ -0.179828   │
│ 47  │ Hamlet.5.First Priest              │ -0.67013   │ 0.507739    │
│ 48  │ Hamlet.5.QUEEN GERTRUDE            │ -0.594392  │ 0.178605    │
│ 49  │ Hamlet.5.KING CLAUDIUS             │ 0.214469   │ 0.483191    │
│ 50  │ Hamlet.5.OSRIC                     │ 0.248713   │ -0.416831   │
│ 51  │ Hamlet.5.Lord                      │ -0.294284  │ -0.169921   │
│ 52  │ Hamlet.5.PRINCE FORTINBRAS         │ 0.306622   │ 0.507739    │
│ 53  │ Romeo and Juliet.1.RICHMOND        │ -0.127133  │ 0.260829    │
│ 54  │ Romeo and Juliet.1.SAMPSON         │ -0.294284  │ -0.169921   │
│ 55  │ Romeo and Juliet.1.BENVOLIO        │ -0.350599  │ -0.161825   │
│ 56  │ Romeo and Juliet.1.TYBALT          │ -0.0525362 │ 0.542555    │
│ 57  │ Romeo and Juliet.1.CAPULET         │ -0.199022  │ -0.40782    │
│ 58  │ Romeo and Juliet.1.LADY CAPULET    │ -0.564782  │ -0.220394   │
│ 59  │ Romeo and Juliet.1.ROMEO           │ -0.150526  │ -0.53824    │
│ 60  │ Romeo and Juliet.1.PARIS           │ 0.110288   │ 0.415216    │
│ 61  │ Romeo and Juliet.1.Servant         │ -0.63534   │ -0.475165   │
│ 62  │ Romeo and Juliet.1.Nurse           │ -0.698532  │ -0.381688   │
│ 63  │ Romeo and Juliet.1.JULIET          │ 0.248713   │ -0.416831   │
│ 64  │ Romeo and Juliet.1.MERCUTIO        │ -0.323271  │ -0.313912   │
│ 65  │ Romeo and Juliet.1.Second Servant  │ 0.248713   │ -0.416831   │
│ 66  │ Romeo and Juliet.1.Second Capulet  │ -0.294284  │ -0.169921   │
│ 67  │ Romeo and Juliet.2.Chorus          │ -0.127133  │ 0.260829    │
│ 68  │ Romeo and Juliet.2.ROMEO           │ -0.219548  │ -0.354032   │
│ 69  │ Romeo and Juliet.2.BENVOLIO        │ -0.195407  │ -0.43724    │
│ 70  │ Romeo and Juliet.2.MERCUTIO        │ -0.355922  │ -0.359822   │
│ 71  │ Romeo and Juliet.2.JULIET          │ -0.0855872 │ -0.269953   │
│ 72  │ Romeo and Juliet.2.Nurse           │ -0.33991   │ -0.357082   │
│ 73  │ Romeo and Juliet.2.FRIAR LAURENCE  │ -0.209845  │ -0.0855485  │
│ 74  │ Romeo and Juliet.2.PETER           │ 0.248713   │ -0.416831   │
│ 75  │ Romeo and Juliet.2.NURSE           │ -0.294284  │ -0.169921   │
│ 76  │ Romeo and Juliet.3.BENVOLIO        │ 0.306622   │ 0.507739    │
│ 77  │ Romeo and Juliet.3.MERCUTIO        │ 0.480232   │ 0.00401306  │
│ 78  │ Romeo and Juliet.3.TYBALT          │ 0.480232   │ 0.00401306  │
│ 79  │ Romeo and Juliet.3.ROMEO           │ -0.11185   │ 0.028396    │
│ 80  │ Romeo and Juliet.3.LADY CAPULET    │ -0.36297   │ 0.0661521   │
│ 81  │ Romeo and Juliet.3.JULIET          │ -0.121284  │ -0.0356081  │
│ 82  │ Romeo and Juliet.3.Nurse           │ -0.0945603 │ -0.0513118  │
│ 83  │ Romeo and Juliet.3.FRIAR LAURENCE  │ 0.183998   │ 0.0559629   │
│ 84  │ Romeo and Juliet.3.CAPULET         │ -0.219304  │ 0.178015    │
│ 85  │ Romeo and Juliet.3.PARIS           │ 0.257685   │ -0.329656   │
│ 86  │ Romeo and Juliet.4.FRIAR LAURENCE  │ -0.208465  │ 0.121236    │
│ 87  │ Romeo and Juliet.4.PARIS           │ -0.313144  │ -0.337183   │
│ 88  │ Romeo and Juliet.4.JULIET          │ -0.079361  │ 0.100566    │
│ 89  │ Romeo and Juliet.4.CAPULET         │ 0.0458911  │ 0.0181069   │
│ 90  │ Romeo and Juliet.4.Second Servant  │ 0.248713   │ -0.416831   │
│ 91  │ Romeo and Juliet.4.Nurse           │ -0.0373858 │ 0.0661521   │
│ 92  │ Romeo and Juliet.4.LADY CAPULET    │ -0.169488  │ 0.657783    │
│ 93  │ Romeo and Juliet.5.ROMEO           │ 0.156669   │ 0.0610117   │
│ 94  │ Romeo and Juliet.5.BALTHASAR       │ 0.333529   │ 0.0768873   │
│ 95  │ Romeo and Juliet.5.Apothecary      │ 0.306622   │ 0.507739    │
│ 96  │ Romeo and Juliet.5.FRIAR LAURENCE  │ -0.277583  │ 0.514328    │
│ 97  │ Romeo and Juliet.5.PARIS           │ 0.433785   │ 0.258778    │
│ 98  │ Romeo and Juliet.5.PAGE            │ -0.258478  │ -0.152133   │
│ 99  │ Romeo and Juliet.5.JULIET          │ -0.173304  │ 0.207344    │
│ 100 │ Romeo and Juliet.5.First Watchman  │ 0.370891   │ 0.208505    │
│ 101 │ Romeo and Juliet.5.Second Watchman │ 0.306622   │ 0.507739    │
│ 102 │ Romeo and Juliet.5.PRINCE          │ -0.0999541 │ 0.183739    │
│ 103 │ Romeo and Juliet.5.CAPULET         │ -0.830726  │ 0.0829252   │
│ 104 │ Romeo and Juliet.5.LADY CAPULET    │ -0.169488  │ 0.657783    │
│ 105 │ Romeo and Juliet.5.MONTAGUE        │ -0.67013   │ 0.507739    │
Codes:
5×14 DataFrame. Omitted printing of 8 columns
│ Row │ code   │ density  │ pos_x      │ pos_y     │ Death_Honor  │ Death_M
en │
│     │ Symbol │ Float64  │ Float64    │ Float64   │ Real         │ Real   
   │
├─────┼────────┼──────────┼────────────┼───────────┼──────────────┼────────
───┤
│ 1   │ Love   │ 0.686152 │ 0.0263264  │ -0.809243 │ -0.0232083   │ -0.4597
82 │
│ 2   │ Death  │ 0.6511   │ 0.142143   │ 1.0399    │ 0.0724987    │ 0.95018
3  │
│ 3   │ Honor  │ 0.1786   │ -0.0227257 │ 0.714604  │ 0.196636     │ 0.04966
59 │
│ 4   │ Men    │ 1.0      │ 0.893836   │ -0.315423 │ -0.0255981   │ 0.65995
1  │
│ 5   │ Women  │ 0.595926 │ -1.05967   │ -0.315423 │ -0.000533696 │ -0.5101
72 │
Network:
10×6 DataFrame. Omitted printing of 1 columns
│ Row │ relationship │ response │ referent │ density   │ weight_x   │
│     │ Symbol       │ Int64    │ Int64    │ Float64   │ Float64    │
├─────┼──────────────┼──────────┼──────────┼───────────┼────────────┤
│ 1   │ Love_Death   │ 1        │ 2        │ 0.456959  │ -0.128882  │
│ 2   │ Love_Honor   │ 1        │ 3        │ 0.158203  │ -0.0351264 │
│ 3   │ Death_Men    │ 2        │ 4        │ 1.0       │ 0.598987   │
│ 4   │ Men_Women    │ 4        │ 5        │ 0.785616  │ -0.176839  │
│ 5   │ Love_Women   │ 1        │ 5        │ 0.451214  │ -0.340863  │
│ 6   │ Love_Men     │ 1        │ 4        │ 0.97818   │ 0.504871   │
│ 7   │ Death_Women  │ 2        │ 5        │ 0.431999  │ -0.457275  │
│ 8   │ Honor_Men    │ 3        │ 4        │ 0.215949  │ 0.096782   │
│ 9   │ Death_Honor  │ 2        │ 3        │ 0.0511535 │ -0.0128305 │
│ 10  │ Honor_Women  │ 3        │ 5        │ 0.106877  │ -0.0488251 │
coregistration_y:
0.9547099984504396

variance_x:
0.245250633446139

variance_y:
0.270059577709829

correlation_y:
0.9542740001218789

coregistration_x:
0.9622753233357989

correlation_x:
0.9635244993338363

Analysis (Acts over Time)

SVD

Note that (a) the groups have a lot of overlap, though (i-r) we see some differences.

let # create a non-global scope

rotation = SVDRotation()
ena = ENAModel(data, codes, conversations, units, dropEmpty=dropEmpty, sphereNormalize=sphereNormalize, rotateBy=rotation)
p = plot(ena, groupBy=:Act)
display(p)
display(ena)

end # let
Units (centroids):
105×13 DataFrame. Omitted printing of 10 columns
│ Row │ ENA_UNIT                           │ pos_x       │ pos_y       │
│     │ String                             │ Float64     │ Float64     │
├─────┼────────────────────────────────────┼─────────────┼─────────────┤
│ 1   │ Hamlet.1.BERNARDO                  │ -0.64166    │ -0.0547483  │
│ 2   │ Hamlet.1.HORATIO                   │ -0.403599   │ -0.0973322  │
│ 3   │ Hamlet.1.MARCELLUS                 │ -0.511805   │ -0.168013   │
│ 4   │ Hamlet.1.KING CLAUDIUS             │ -0.169272   │ -0.223691   │
│ 5   │ Hamlet.1.LAERTES                   │ 0.476418    │ 0.0534875   │
│ 6   │ Hamlet.1.LORD POLONIUS             │ 0.455798    │ 0.100253    │
│ 7   │ Hamlet.1.HAMLET                    │ -0.318004   │ -0.122185   │
│ 8   │ Hamlet.1.QUEEN GERTRUDE            │ -0.621148   │ -0.00404228 │
│ 9   │ Hamlet.1.All                       │ 0.295554    │ -0.383389   │
│ 10  │ Hamlet.1.OPHELIA                   │ 0.487379    │ -0.136244   │
│ 11  │ Hamlet.1.Ghost                     │ 0.00845416  │ 0.0365347   │
│ 12  │ Hamlet.2.LORD POLONIUS             │ 0.147293    │ -0.42442    │
│ 13  │ Hamlet.2.OPHELIA                   │ 0.264969    │ -0.488384   │
│ 14  │ Hamlet.2.KING CLAUDIUS             │ 0.31823     │ -0.248204   │
│ 15  │ Hamlet.2.QUEEN GERTRUDE            │ -0.261743   │ -0.363424   │
│ 16  │ Hamlet.2.ROSENCRANTZ               │ 0.277291    │ 0.182432    │
│ 17  │ Hamlet.2.GUILDENSTERN              │ 0.0744729   │ -0.452637   │
│ 18  │ Hamlet.2.HAMLET                    │ 0.333423    │ -0.086784   │
│ 19  │ Hamlet.2.First Player              │ 0.0193397   │ 0.0845115   │
│ 20  │ Hamlet.3.KING CLAUDIUS             │ -0.144224   │ 0.261119    │
│ 21  │ Hamlet.3.ROSENCRANTZ               │ 0.0486245   │ -0.474338   │
│ 22  │ Hamlet.3.GUILDENSTERN              │ 0.370873    │ 0.0714189   │
│ 23  │ Hamlet.3.QUEEN GERTRUDE            │ 0.323651    │ -0.323495   │
│ 24  │ Hamlet.3.LORD POLONIUS             │ 0.330603    │ 0.252654    │
│ 25  │ Hamlet.3.OPHELIA                   │ 0.0148982   │ -0.0672402  │
│ 26  │ Hamlet.3.HAMLET                    │ 0.306046    │ -0.0746932  │
│ 27  │ Hamlet.3.First Player              │ 0.197964    │ -0.258991   │
│ 28  │ Hamlet.3.HORATIO                   │ -0.299717   │ -0.0510121  │
│ 29  │ Hamlet.3.Player King               │ 0.414806    │ -0.36946    │
│ 30  │ Hamlet.3.Player Queen              │ 0.559489    │ -0.0241194  │
│ 31  │ Hamlet.4.KING CLAUDIUS             │ -0.0805199  │ -0.0190008  │
│ 32  │ Hamlet.4.QUEEN GERTRUDE            │ 0.083993    │ 0.592976    │
│ 33  │ Hamlet.4.HAMLET                    │ -0.685332   │ 0.0528171   │
│ 34  │ Hamlet.4.ROSENCRANTZ               │ -0.478395   │ -0.292199   │
│ 35  │ Hamlet.4.PRINCE FORTINBRAS         │ -0.0613496  │ -0.0638115  │
│ 36  │ Hamlet.4.Captain                   │ -0.299717   │ -0.0510121  │
│ 37  │ Hamlet.4.Gentleman                 │ -0.621148   │ -0.00404228 │
│ 38  │ Hamlet.4.HORATIO                   │ -0.621148   │ -0.00404228 │
│ 39  │ Hamlet.4.OPHELIA                   │ -0.21518    │ -0.0324831  │
│ 40  │ Hamlet.4.LAERTES                   │ -0.292335   │ -0.0316747  │
│ 41  │ Hamlet.4.Servant                   │ -0.621148   │ -0.00404228 │
│ 42  │ Hamlet.4.Messenger                 │ 0.58799     │ -0.00597854 │
│ 43  │ Hamlet.5.First Clown               │ -0.558328   │ 0.166776    │
│ 44  │ Hamlet.5.HAMLET                    │ 0.0210134   │ -0.0185903  │
│ 45  │ Hamlet.5.HORATIO                   │ 0.140473    │ -0.0657693  │
│ 46  │ Hamlet.5.LAERTES                   │ 0.421233    │ -0.0412879  │
│ 47  │ Hamlet.5.First Priest              │ -0.164714   │ 0.659672    │
│ 48  │ Hamlet.5.QUEEN GERTRUDE            │ 0.0717617   │ 0.754235    │
│ 49  │ Hamlet.5.KING CLAUDIUS             │ -0.576333   │ -0.199968   │
│ 50  │ Hamlet.5.OSRIC                     │ 0.264969    │ -0.488384   │
│ 51  │ Hamlet.5.Lord                      │ 0.280183    │ 0.428511    │
│ 52  │ Hamlet.5.PRINCE FORTINBRAS         │ -0.621148   │ -0.00404228 │
│ 53  │ Romeo and Juliet.1.RICHMOND        │ -0.179928   │ -0.257223   │
│ 54  │ Romeo and Juliet.1.SAMPSON         │ 0.280183    │ 0.428511    │
│ 55  │ Romeo and Juliet.1.BENVOLIO        │ 0.226656    │ 0.0656387   │
│ 56  │ Romeo and Juliet.1.TYBALT          │ -0.231253   │ 0.0796132   │
│ 57  │ Romeo and Juliet.1.CAPULET         │ 0.59085     │ 0.0787588   │
│ 58  │ Romeo and Juliet.1.LADY CAPULET    │ 0.749126    │ -0.0741517  │
│ 59  │ Romeo and Juliet.1.ROMEO           │ 0.492456    │ -0.132321   │
│ 60  │ Romeo and Juliet.1.PARIS           │ -0.117107   │ -0.0389732  │
│ 61  │ Romeo and Juliet.1.Servant         │ 0.698341    │ 0.411754    │
│ 62  │ Romeo and Juliet.1.Nurse           │ 0.793665    │ 0.296864    │
│ 63  │ Romeo and Juliet.1.JULIET          │ 0.264969    │ -0.488384   │
│ 64  │ Romeo and Juliet.1.MERCUTIO        │ 0.37918     │ -0.16798    │
│ 65  │ Romeo and Juliet.1.Second Servant  │ 0.264969    │ -0.488384   │
│ 66  │ Romeo and Juliet.1.Second Capulet  │ 0.280183    │ 0.428511    │
│ 67  │ Romeo and Juliet.2.Chorus          │ -0.179928   │ -0.257223   │
│ 68  │ Romeo and Juliet.2.ROMEO           │ 0.343329    │ -0.0457198  │
│ 69  │ Romeo and Juliet.2.BENVOLIO        │ 0.448128    │ -0.356159   │
│ 70  │ Romeo and Juliet.2.MERCUTIO        │ 0.40891     │ 0.281702    │
│ 71  │ Romeo and Juliet.2.JULIET          │ 0.274571    │ -0.339512   │
│ 72  │ Romeo and Juliet.2.Nurse           │ 0.42501     │ 0.348419    │
│ 73  │ Romeo and Juliet.2.FRIAR LAURENCE  │ 0.0845107   │ 0.149654    │
│ 74  │ Romeo and Juliet.2.PETER           │ 0.264969    │ -0.488384   │
│ 75  │ Romeo and Juliet.2.NURSE           │ 0.280183    │ 0.428511    │
│ 76  │ Romeo and Juliet.3.BENVOLIO        │ -0.621148   │ -0.00404228 │
│ 77  │ Romeo and Juliet.3.MERCUTIO        │ -0.261743   │ -0.363424   │
│ 78  │ Romeo and Juliet.3.TYBALT          │ -0.261743   │ -0.363424   │
│ 79  │ Romeo and Juliet.3.ROMEO           │ -0.00183873 │ -0.219765   │
│ 80  │ Romeo and Juliet.3.LADY CAPULET    │ 0.0135253   │ 0.342166    │
│ 81  │ Romeo and Juliet.3.JULIET          │ 0.0450594   │ 0.0576671   │
│ 82  │ Romeo and Juliet.3.Nurse           │ 0.0224297   │ 0.250042    │
│ 83  │ Romeo and Juliet.3.FRIAR LAURENCE  │ -0.18197    │ -0.0413461  │
│ 84  │ Romeo and Juliet.3.CAPULET         │ -0.114447   │ 0.383989    │
│ 85  │ Romeo and Juliet.3.PARIS           │ 0.123822    │ -0.254156   │
│ 86  │ Romeo and Juliet.4.FRIAR LAURENCE  │ -0.0233257  │ 0.196731    │
│ 87  │ Romeo and Juliet.4.PARIS           │ 0.364895    │ 0.0800164   │
│ 88  │ Romeo and Juliet.4.JULIET          │ 0.0338424   │ -0.0966568  │
│ 89  │ Romeo and Juliet.4.CAPULET         │ -0.12236    │ -0.155677   │
│ 90  │ Romeo and Juliet.4.Second Servant  │ 0.264969    │ -0.488384   │
│ 91  │ Romeo and Juliet.4.Nurse           │ -0.138619   │ 0.120928    │
│ 92  │ Romeo and Juliet.4.LADY CAPULET    │ -0.565575   │ 0.448374    │
│ 93  │ Romeo and Juliet.5.ROMEO           │ -0.215653   │ -0.0280108  │
│ 94  │ Romeo and Juliet.5.BALTHASAR       │ -0.294773   │ -0.0692217  │
│ 95  │ Romeo and Juliet.5.Apothecary      │ -0.621148   │ -0.00404228 │
│ 96  │ Romeo and Juliet.5.FRIAR LAURENCE  │ -0.410758   │ 0.558697    │
│ 97  │ Romeo and Juliet.5.PARIS           │ -0.487556   │ -0.330962   │
│ 98  │ Romeo and Juliet.5.PAGE            │ 0.202173    │ 0.319384    │
│ 99  │ Romeo and Juliet.5.JULIET          │ -0.203306   │ 0.186886    │
│ 100 │ Romeo and Juliet.5.First Watchman  │ -0.409595   │ -0.0403663  │
│ 101 │ Romeo and Juliet.5.Second Watchman │ -0.621148   │ -0.00404228 │
│ 102 │ Romeo and Juliet.5.PRINCE          │ -0.214217   │ 0.310984    │
│ 103 │ Romeo and Juliet.5.CAPULET         │ 0.259298    │ 0.761869    │
│ 104 │ Romeo and Juliet.5.LADY CAPULET    │ -0.565575   │ 0.448374    │
│ 105 │ Romeo and Juliet.5.MONTAGUE        │ -0.164714   │ 0.659672    │
Codes:
5×14 DataFrame. Omitted printing of 8 columns
│ Row │ code   │ density  │ pos_x    │ pos_y      │ Death_Honor  │ Death_Me
n │
│     │ Symbol │ Float64  │ Float64  │ Float64    │ Real         │ Real    
  │
├─────┼────────┼──────────┼──────────┼────────────┼──────────────┼─────────
──┤
│ 1   │ Love   │ 0.686152 │ 0.682321 │ -0.778324  │ -0.0232083   │ -0.45978
2 │
│ 2   │ Death  │ 0.6511   │ -1.08991 │ 0.19036    │ 0.0724987    │ 0.950183
  │
│ 3   │ Honor  │ 0.1786   │ -0.13895 │ -0.0619725 │ 0.196636     │ 0.049665
9 │
│ 4   │ Men    │ 1.0      │ -0.20012 │ -0.271963  │ -0.0255981   │ 0.659951
  │
│ 5   │ Women  │ 0.595926 │ 0.712748 │ 1.05547    │ -0.000533696 │ -0.51017
2 │
Network:
10×6 DataFrame. Omitted printing of 1 columns
│ Row │ relationship │ response │ referent │ density   │ weight_x    │
│     │ Symbol       │ Int64    │ Int64    │ Float64   │ Float64     │
├─────┼──────────────┼──────────┼──────────┼───────────┼─────────────┤
│ 1   │ Love_Death   │ 1        │ 2        │ 0.456959  │ 0.0376315   │
│ 2   │ Love_Honor   │ 1        │ 3        │ 0.158203  │ 0.100846    │
│ 3   │ Death_Men    │ 2        │ 4        │ 1.0       │ -0.830602   │
│ 4   │ Men_Women    │ 4        │ 5        │ 0.785616  │ 0.344966    │
│ 5   │ Love_Women   │ 1        │ 5        │ 0.451214  │ 0.226457    │
│ 6   │ Love_Men     │ 1        │ 4        │ 0.97818   │ 0.334342    │
│ 7   │ Death_Women  │ 2        │ 5        │ 0.431999  │ -0.00269219 │
│ 8   │ Honor_Men    │ 3        │ 4        │ 0.215949  │ 0.106658    │
│ 9   │ Death_Honor  │ 2        │ 3        │ 0.0511535 │ 0.00676609  │
│ 10  │ Honor_Women  │ 3        │ 5        │ 0.106877  │ 0.070831    │
coregistration_y:
0.9278695160166626

variance_x:
0.3016013790464127

variance_y:
0.19364529443874579

correlation_y:
0.9292058300589341

coregistration_x:
0.9385217939730804

correlation_x:
0.9384811240971104

F1

Note that (a) time appears to move from Love to Honor to Death, Men and Women are both around the origin along X, and 1/2/3/4/5 all overlap, but line up in Act number order.

let # create a non-global scope

rotation = FormulaRotation(
    LinearModel, 2, @formula(col ~ 1 + Act), nothing
)
ena = ENAModel(data, codes, conversations, units, dropEmpty=dropEmpty, sphereNormalize=sphereNormalize, rotateBy=rotation)
p = plot(ena, groupBy=:Act)
display(p)
display(ena)

end # let
Units (centroids):
105×13 DataFrame. Omitted printing of 10 columns
│ Row │ ENA_UNIT                           │ pos_x      │ pos_y      │
│     │ String                             │ Float64    │ Float64    │
├─────┼────────────────────────────────────┼────────────┼────────────┤
│ 1   │ Hamlet.1.BERNARDO                  │ 0.445063   │ 0.324485   │
│ 2   │ Hamlet.1.HORATIO                   │ 0.303142   │ 0.261737   │
│ 3   │ Hamlet.1.MARCELLUS                 │ 0.364828   │ 0.361846   │
│ 4   │ Hamlet.1.KING CLAUDIUS             │ 0.127416   │ 0.249176   │
│ 5   │ Hamlet.1.LAERTES                   │ -0.445331  │ -0.224349  │
│ 6   │ Hamlet.1.LORD POLONIUS             │ -0.485318  │ -0.228213  │
│ 7   │ Hamlet.1.HAMLET                    │ 0.1999     │ 0.242243   │
│ 8   │ Hamlet.1.QUEEN GERTRUDE            │ 0.490338   │ 0.255995   │
│ 9   │ Hamlet.1.All                       │ -0.580886  │ 0.253872   │
│ 10  │ Hamlet.1.OPHELIA                   │ -0.576247  │ -0.0303888 │
│ 11  │ Hamlet.1.Ghost                     │ 0.0792944  │ -0.0686928 │
│ 12  │ Hamlet.2.LORD POLONIUS             │ -0.304217  │ 0.349048   │
│ 13  │ Hamlet.2.OPHELIA                   │ -0.387393  │ 0.34913    │
│ 14  │ Hamlet.2.KING CLAUDIUS             │ -0.419218  │ 0.114141   │
│ 15  │ Hamlet.2.QUEEN GERTRUDE            │ 0.107437   │ 0.441309   │
│ 16  │ Hamlet.2.ROSENCRANTZ               │ -0.195801  │ -0.246198  │
│ 17  │ Hamlet.2.GUILDENSTERN              │ -0.3338    │ 0.423625   │
│ 18  │ Hamlet.2.HAMLET                    │ -0.26893   │ -0.0498409 │
│ 19  │ Hamlet.2.First Player              │ 0.0342922  │ -0.0916546 │
│ 20  │ Hamlet.3.KING CLAUDIUS             │ 0.260653   │ -0.183896  │
│ 21  │ Hamlet.3.ROSENCRANTZ               │ -0.190298  │ 0.42075    │
│ 22  │ Hamlet.3.GUILDENSTERN              │ -0.257184  │ -0.196298  │
│ 23  │ Hamlet.3.QUEEN GERTRUDE            │ -0.512191  │ 0.207527   │
│ 24  │ Hamlet.3.LORD POLONIUS             │ -0.141747  │ -0.353559  │
│ 25  │ Hamlet.3.OPHELIA                   │ -0.0743167 │ 0.0855218  │
│ 26  │ Hamlet.3.HAMLET                    │ -0.216462  │ -0.0586651 │
│ 27  │ Hamlet.3.First Player              │ -0.499636  │ 0.212514   │
│ 28  │ Hamlet.3.HORATIO                   │ 0.258524   │ 0.174576   │
│ 29  │ Hamlet.3.Player King               │ -0.52298   │ 0.177478   │
│ 30  │ Hamlet.3.Player Queen              │ -0.500534  │ -0.209901  │
│ 31  │ Hamlet.4.KING CLAUDIUS             │ 0.135712   │ 0.0253973  │
│ 32  │ Hamlet.4.QUEEN GERTRUDE            │ 0.185884   │ -0.588886  │
│ 33  │ Hamlet.4.HAMLET                    │ 0.52002    │ 0.241088   │
│ 34  │ Hamlet.4.ROSENCRANTZ               │ 0.31246    │ 0.453773   │
│ 35  │ Hamlet.4.PRINCE FORTINBRAS         │ 0.0688672  │ 0.0938037  │
│ 36  │ Hamlet.4.Captain                   │ 0.258524   │ 0.174576   │
│ 37  │ Hamlet.4.Gentleman                 │ 0.490338   │ 0.255995   │
│ 38  │ Hamlet.4.HORATIO                   │ 0.490338   │ 0.255995   │
│ 39  │ Hamlet.4.OPHELIA                   │ 0.227291   │ 0.0858043  │
│ 40  │ Hamlet.4.LAERTES                   │ 0.293878   │ 0.126539   │
│ 41  │ Hamlet.4.Servant                   │ 0.490338   │ 0.255995   │
│ 42  │ Hamlet.4.Messenger                 │ -0.441288  │ -0.221752  │
│ 43  │ Hamlet.5.First Clown               │ 0.518784   │ 0.0738893  │
│ 44  │ Hamlet.5.HAMLET                    │ 0.0332441  │ 0.00490291 │
│ 45  │ Hamlet.5.HORATIO                   │ -0.0988653 │ 0.0171957  │
│ 46  │ Hamlet.5.LAERTES                   │ -0.433801  │ -0.12225   │
│ 47  │ Hamlet.5.First Priest              │ 0.340799   │ -0.553985  │
│ 48  │ Hamlet.5.QUEEN GERTRUDE            │ 0.21219    │ -0.720358  │
│ 49  │ Hamlet.5.KING CLAUDIUS             │ 0.411853   │ 0.391635   │
│ 50  │ Hamlet.5.OSRIC                     │ -0.387393  │ 0.34913    │
│ 51  │ Hamlet.5.Lord                      │ -0.0897107 │ -0.483735  │
│ 52  │ Hamlet.5.PRINCE FORTINBRAS         │ 0.490338   │ 0.255995   │
│ 53  │ Romeo and Juliet.1.RICHMOND        │ 0.0431175  │ 0.278881   │
│ 54  │ Romeo and Juliet.1.SAMPSON         │ -0.0897107 │ -0.483735  │
│ 55  │ Romeo and Juliet.1.BENVOLIO        │ -0.0916963 │ -0.184012  │
│ 56  │ Romeo and Juliet.1.TYBALT          │ 0.0660201  │ 0.0357639  │
│ 57  │ Romeo and Juliet.1.CAPULET         │ -0.526476  │ -0.278895  │
│ 58  │ Romeo and Juliet.1.LADY CAPULET    │ -0.819413  │ -0.210967  │
│ 59  │ Romeo and Juliet.1.ROMEO           │ -0.383018  │ -0.0891757 │
│ 60  │ Romeo and Juliet.1.PARIS           │ -0.122272  │ 0.124377   │
│ 61  │ Romeo and Juliet.1.Servant         │ -0.40846   │ -0.654501  │
│ 62  │ Romeo and Juliet.1.Nurse           │ -0.619972  │ -0.577331  │
│ 63  │ Romeo and Juliet.1.JULIET          │ -0.387393  │ 0.34913    │
│ 64  │ Romeo and Juliet.1.MERCUTIO        │ -0.315545  │ -0.030419  │
│ 65  │ Romeo and Juliet.1.Second Servant  │ -0.387393  │ 0.34913    │
│ 66  │ Romeo and Juliet.1.Second Capulet  │ -0.0897107 │ -0.483735  │
│ 67  │ Romeo and Juliet.2.Chorus          │ 0.0431175  │ 0.278881   │
│ 68  │ Romeo and Juliet.2.ROMEO           │ -0.222973  │ -0.119224  │
│ 69  │ Romeo and Juliet.2.BENVOLIO        │ -0.447539  │ 0.12023    │
│ 70  │ Romeo and Juliet.2.MERCUTIO        │ -0.165737  │ -0.432712  │
│ 71  │ Romeo and Juliet.2.JULIET          │ -0.315643  │ 0.177818   │
│ 72  │ Romeo and Juliet.2.Nurse           │ -0.183234  │ -0.485748  │
│ 73  │ Romeo and Juliet.2.FRIAR LAURENCE  │ 0.0557123  │ -0.19412   │
│ 74  │ Romeo and Juliet.2.PETER           │ -0.387393  │ 0.34913    │
│ 75  │ Romeo and Juliet.2.NURSE           │ -0.0897107 │ -0.483735  │
│ 76  │ Romeo and Juliet.3.BENVOLIO        │ 0.490338   │ 0.255995   │
│ 77  │ Romeo and Juliet.3.MERCUTIO        │ 0.107437   │ 0.441309   │
│ 78  │ Romeo and Juliet.3.TYBALT          │ 0.107437   │ 0.441309   │
│ 79  │ Romeo and Juliet.3.ROMEO           │ -0.0430093 │ 0.169216   │
│ 80  │ Romeo and Juliet.3.LADY CAPULET    │ 0.178522   │ -0.346315  │
│ 81  │ Romeo and Juliet.3.JULIET          │ 0.030263   │ -0.0900978 │
│ 82  │ Romeo and Juliet.3.Nurse           │ 0.123399   │ -0.244159  │
│ 83  │ Romeo and Juliet.3.FRIAR LAURENCE  │ 0.177006   │ 0.102627   │
│ 84  │ Romeo and Juliet.3.CAPULET         │ 0.269042   │ -0.318998  │
│ 85  │ Romeo and Juliet.3.PARIS           │ -0.141134  │ 0.1849     │
│ 86  │ Romeo and Juliet.4.FRIAR LAURENCE  │ 0.10851    │ -0.187093  │
│ 87  │ Romeo and Juliet.4.PARIS           │ -0.192648  │ -0.24355   │
│ 88  │ Romeo and Juliet.4.JULIET          │ -0.09889   │ 0.0661351  │
│ 89  │ Romeo and Juliet.4.CAPULET         │ 0.114427   │ 0.162659   │
│ 90  │ Romeo and Juliet.4.Second Servant  │ -0.387393  │ 0.34913    │
│ 91  │ Romeo and Juliet.4.Nurse           │ 0.228368   │ -0.0763215 │
│ 92  │ Romeo and Juliet.4.LADY CAPULET    │ 0.622346   │ -0.19729   │
│ 93  │ Romeo and Juliet.5.ROMEO           │ 0.232634   │ 0.0968567  │
│ 94  │ Romeo and Juliet.5.BALTHASAR       │ 0.264316   │ 0.180796   │
│ 95  │ Romeo and Juliet.5.Apothecary      │ 0.490338   │ 0.255995   │
│ 96  │ Romeo and Juliet.5.FRIAR LAURENCE  │ 0.56163    │ -0.363323  │
│ 97  │ Romeo and Juliet.5.PARIS           │ 0.312751   │ 0.485913   │
│ 98  │ Romeo and Juliet.5.PAGE            │ -0.0174691 │ -0.373838  │
│ 99  │ Romeo and Juliet.5.JULIET          │ 0.300358   │ -0.120721  │
│ 100 │ Romeo and Juliet.5.First Watchman  │ 0.342126   │ 0.207416   │
│ 101 │ Romeo and Juliet.5.Second Watchman │ 0.490338   │ 0.255995   │
│ 102 │ Romeo and Juliet.5.PRINCE          │ 0.347556   │ -0.214928  │
│ 103 │ Romeo and Juliet.5.CAPULET         │ 0.0753772  │ -0.817442  │
│ 104 │ Romeo and Juliet.5.LADY CAPULET    │ 0.622346   │ -0.19729   │
│ 105 │ Romeo and Juliet.5.MONTAGUE        │ 0.340799   │ -0.553985  │
Codes:
5×14 DataFrame. Omitted printing of 8 columns
│ Row │ code   │ density  │ pos_x     │ pos_y    │ Death_Honor  │ Death_Men
 │
│     │ Symbol │ Float64  │ Float64   │ Float64  │ Real         │ Real     
 │
├─────┼────────┼──────────┼───────────┼──────────┼──────────────┼──────────
─┤
│ 1   │ Love   │ 0.686152 │ -0.750977 │ 0.404417 │ -0.0232083   │ -0.459782
 │
│ 2   │ Death  │ 0.6511   │ 1.00448   │ 0.218146 │ 0.0724987    │ 0.950183 
 │
│ 3   │ Honor  │ 0.1786   │ -0.243522 │ 0.168128 │ 0.196636     │ 0.0496659
 │
│ 4   │ Men    │ 1.0      │ 0.143464  │ 0.358645 │ -0.0255981   │ 0.659951 
 │
│ 5   │ Women  │ 0.595926 │ -0.155613 │ -1.26131 │ -0.000533696 │ -0.510172
 │
Network:
10×6 DataFrame. Omitted printing of 1 columns
│ Row │ relationship │ response │ referent │ density   │ weight_x  │
│     │ Symbol       │ Int64    │ Int64    │ Float64   │ Float64   │
├─────┼──────────────┼──────────┼──────────┼───────────┼───────────┤
│ 1   │ Love_Death   │ 1        │ 2        │ 0.456959  │ -0.108465 │
│ 2   │ Love_Honor   │ 1        │ 3        │ 0.158203  │ -0.235157 │
│ 3   │ Death_Men    │ 2        │ 4        │ 1.0       │ 0.652461  │
│ 4   │ Men_Women    │ 4        │ 5        │ 0.785616  │ -0.100787 │
│ 5   │ Love_Women   │ 1        │ 5        │ 0.451214  │ -0.283472 │
│ 6   │ Love_Men     │ 1        │ 4        │ 0.97818   │ -0.264275 │
│ 7   │ Death_Women  │ 2        │ 5        │ 0.431999  │ 0.487276  │
│ 8   │ Honor_Men    │ 3        │ 4        │ 0.215949  │ -0.27969  │
│ 9   │ Death_Honor  │ 2        │ 3        │ 0.0511535 │ -0.036357 │
│ 10  │ Honor_Women  │ 3        │ 5        │ 0.106877  │ -0.172886 │
coregistration_y:
0.9282670395136624

variance_x:
0.2359110847970496

variance_y:
0.21006241162460226

correlation_y:
0.9297024736313843

coregistration_x:
0.970262238926118

correlation_x:
0.9713742301685365

LDA (no subspace adjustment)

These axes are non-orthogonal.

Note that variance explained along Y is low and the coregistrations could be better.

Note that (a) the X axis seems similar to the F1 plot in that it moves from love, to honor, to death, but here (i-r) all pairs are pulled apart except for 2/3, 3/4, and 4/5. That's good for just two LDA axes.

let # create a non-global scope

rotation = LDARotation(:Act)
ena = ENAModel(data, codes, conversations, units, dropEmpty=dropEmpty, sphereNormalize=sphereNormalize, rotateBy=rotation)
p = plot(ena, lims=1)
display(p)
display(ena)

end # let
Units (centroids):
105×13 DataFrame. Omitted printing of 10 columns
│ Row │ ENA_UNIT                           │ pos_x       │ pos_y       │
│     │ String                             │ Float64     │ Float64     │
├─────┼────────────────────────────────────┼─────────────┼─────────────┤
│ 1   │ Hamlet.1.BERNARDO                  │ 0.159327    │ 0.0522905   │
│ 2   │ Hamlet.1.HORATIO                   │ 0.117409    │ -0.0782427  │
│ 3   │ Hamlet.1.MARCELLUS                 │ 0.11986     │ -0.0356269  │
│ 4   │ Hamlet.1.KING CLAUDIUS             │ 0.038705    │ -0.105799   │
│ 5   │ Hamlet.1.LAERTES                   │ -0.178396   │ 0.0838889   │
│ 6   │ Hamlet.1.LORD POLONIUS             │ -0.20131    │ 0.136136    │
│ 7   │ Hamlet.1.HAMLET                    │ 0.0781429   │ -0.0387156  │
│ 8   │ Hamlet.1.QUEEN GERTRUDE            │ 0.186855    │ 0.0334691   │
│ 9   │ Hamlet.1.All                       │ -0.356495   │ 0.321157    │
│ 10  │ Hamlet.1.OPHELIA                   │ -0.271453   │ 0.0920325   │
│ 11  │ Hamlet.1.Ghost                     │ 0.0591945   │ -0.0561248  │
│ 12  │ Hamlet.2.LORD POLONIUS             │ -0.18938    │ -0.0570957  │
│ 13  │ Hamlet.2.OPHELIA                   │ -0.249484   │ -0.0432505  │
│ 14  │ Hamlet.2.KING CLAUDIUS             │ -0.205962   │ 0.0254768   │
│ 15  │ Hamlet.2.QUEEN GERTRUDE            │ -0.0106869  │ -0.0908838  │
│ 16  │ Hamlet.2.ROSENCRANTZ               │ -0.0617016  │ 0.0040184   │
│ 17  │ Hamlet.2.GUILDENSTERN              │ -0.230974   │ 0.0514564   │
│ 18  │ Hamlet.2.HAMLET                    │ -0.108762   │ -0.0993106  │
│ 19  │ Hamlet.2.First Player              │ 0.0478512   │ -0.0473496  │
│ 20  │ Hamlet.3.KING CLAUDIUS             │ 0.163052    │ -0.0717     │
│ 21  │ Hamlet.3.ROSENCRANTZ               │ -0.156105   │ -0.0841486  │
│ 22  │ Hamlet.3.GUILDENSTERN              │ -0.0978722  │ -0.0571679  │
│ 23  │ Hamlet.3.QUEEN GERTRUDE            │ -0.278718   │ 0.0807984   │
│ 24  │ Hamlet.3.LORD POLONIUS             │ -0.0129274  │ -0.0635233  │
│ 25  │ Hamlet.3.OPHELIA                   │ -0.0370718  │ -0.0476225  │
│ 26  │ Hamlet.3.HAMLET                    │ -0.0805619  │ -0.120795   │
│ 27  │ Hamlet.3.First Player              │ -0.287401   │ 0.260403    │
│ 28  │ Hamlet.3.HORATIO                   │ 0.106547    │ -0.0964578  │
│ 29  │ Hamlet.3.Player King               │ -0.273037   │ 0.0265489   │
│ 30  │ Hamlet.3.Player Queen              │ -0.209444   │ 0.0780669   │
│ 31  │ Hamlet.4.KING CLAUDIUS             │ 0.0775998   │ -0.0991038  │
│ 32  │ Hamlet.4.QUEEN GERTRUDE            │ 0.177382    │ 0.0202954   │
│ 33  │ Hamlet.4.HAMLET                    │ 0.211685    │ 0.0576943   │
│ 34  │ Hamlet.4.ROSENCRANTZ               │ 0.0871948   │ -0.0704441  │
│ 35  │ Hamlet.4.PRINCE FORTINBRAS         │ 0.0295668   │ -0.122665   │
│ 36  │ Hamlet.4.Captain                   │ 0.106547    │ -0.0964578  │
│ 37  │ Hamlet.4.Gentleman                 │ 0.186855    │ 0.0334691   │
│ 38  │ Hamlet.4.HORATIO                   │ 0.186855    │ 0.0334691   │
│ 39  │ Hamlet.4.OPHELIA                   │ 0.106422    │ -0.0515521  │
│ 40  │ Hamlet.4.LAERTES                   │ 0.138124    │ -0.097088   │
│ 41  │ Hamlet.4.Servant                   │ 0.186855    │ 0.0334691   │
│ 42  │ Hamlet.4.Messenger                 │ -0.178527   │ -0.0808292  │
│ 43  │ Hamlet.5.First Clown               │ 0.234849    │ 0.00576986  │
│ 44  │ Hamlet.5.HAMLET                    │ 0.0332621   │ -0.122925   │
│ 45  │ Hamlet.5.HORATIO                   │ -0.0426338  │ -0.116586   │
│ 46  │ Hamlet.5.LAERTES                   │ -0.188009   │ 0.0907094   │
│ 47  │ Hamlet.5.First Priest              │ 0.215514    │ 0.21746     │
│ 48  │ Hamlet.5.QUEEN GERTRUDE            │ 0.193762    │ 0.108232    │
│ 49  │ Hamlet.5.KING CLAUDIUS             │ 0.133932    │ 0.0244511   │
│ 50  │ Hamlet.5.OSRIC                     │ -0.249484   │ -0.0432505  │
│ 51  │ Hamlet.5.Lord                      │ 0.0109917   │ 0.0543517   │
│ 52  │ Hamlet.5.PRINCE FORTINBRAS         │ 0.186855    │ 0.0334691   │
│ 53  │ Romeo and Juliet.1.RICHMOND        │ -0.0449621  │ 0.119858    │
│ 54  │ Romeo and Juliet.1.SAMPSON         │ 0.0109917   │ 0.0543517   │
│ 55  │ Romeo and Juliet.1.BENVOLIO        │ -0.0106822  │ -0.0318195  │
│ 56  │ Romeo and Juliet.1.TYBALT          │ 0.0360838   │ 0.179386    │
│ 57  │ Romeo and Juliet.1.CAPULET         │ -0.210624   │ 0.0493219   │
│ 58  │ Romeo and Juliet.1.LADY CAPULET    │ -0.384651   │ 0.281829    │
│ 59  │ Romeo and Juliet.1.ROMEO           │ -0.163455   │ -0.0956584  │
│ 60  │ Romeo and Juliet.1.PARIS           │ -0.0740031  │ 0.202007    │
│ 61  │ Romeo and Juliet.1.Servant         │ -0.114776   │ 0.0539835   │
│ 62  │ Romeo and Juliet.1.Nurse           │ -0.228843   │ 0.165582    │
│ 63  │ Romeo and Juliet.1.JULIET          │ -0.249484   │ -0.0432505  │
│ 64  │ Romeo and Juliet.1.MERCUTIO        │ -0.149683   │ -0.00997102 │
│ 65  │ Romeo and Juliet.1.Second Servant  │ -0.249484   │ -0.0432505  │
│ 66  │ Romeo and Juliet.1.Second Capulet  │ 0.0109917   │ 0.0543517   │
│ 67  │ Romeo and Juliet.2.Chorus          │ -0.0449621  │ 0.119858    │
│ 68  │ Romeo and Juliet.2.ROMEO           │ -0.0800725  │ -0.0787385  │
│ 69  │ Romeo and Juliet.2.BENVOLIO        │ -0.238112   │ -0.0229121  │
│ 70  │ Romeo and Juliet.2.MERCUTIO        │ -0.00659499 │ -0.0672222  │
│ 71  │ Romeo and Juliet.2.JULIET          │ -0.173423   │ -0.0293859  │
│ 72  │ Romeo and Juliet.2.Nurse           │ -0.0160755  │ -0.0323092  │
│ 73  │ Romeo and Juliet.2.FRIAR LAURENCE  │ 0.0669854   │ -0.0642757  │
│ 74  │ Romeo and Juliet.2.PETER           │ -0.249484   │ -0.0432505  │
│ 75  │ Romeo and Juliet.2.NURSE           │ 0.0109917   │ 0.0543517   │
│ 76  │ Romeo and Juliet.3.BENVOLIO        │ 0.186855    │ 0.0334691   │
│ 77  │ Romeo and Juliet.3.MERCUTIO        │ -0.0106869  │ -0.0908838  │
│ 78  │ Romeo and Juliet.3.TYBALT          │ -0.0106869  │ -0.0908838  │
│ 79  │ Romeo and Juliet.3.ROMEO           │ -0.040678   │ -0.00404825 │
│ 80  │ Romeo and Juliet.3.LADY CAPULET    │ 0.14602     │ -0.0235908  │
│ 81  │ Romeo and Juliet.3.JULIET          │ 0.0450234   │ -0.0578392  │
│ 82  │ Romeo and Juliet.3.Nurse           │ 0.110468    │ -0.0764704  │
│ 83  │ Romeo and Juliet.3.FRIAR LAURENCE  │ 0.0897452   │ -0.0988349  │
│ 84  │ Romeo and Juliet.3.CAPULET         │ 0.190203    │ -0.0224832  │
│ 85  │ Romeo and Juliet.3.PARIS           │ -0.0854458  │ -0.129516   │
│ 86  │ Romeo and Juliet.4.FRIAR LAURENCE  │ 0.0956398   │ -0.00675934 │
│ 87  │ Romeo and Juliet.4.PARIS           │ -0.0463609  │ -0.071366   │
│ 88  │ Romeo and Juliet.4.JULIET          │ -0.0414349  │ 0.0339588   │
│ 89  │ Romeo and Juliet.4.CAPULET         │ 0.0433627   │ -0.0822916  │
│ 90  │ Romeo and Juliet.4.Second Servant  │ -0.249484   │ -0.0432505  │
│ 91  │ Romeo and Juliet.4.Nurse           │ 0.136467    │ -0.084921   │
│ 92  │ Romeo and Juliet.4.LADY CAPULET    │ 0.318116    │ 0.0934663   │
│ 93  │ Romeo and Juliet.5.ROMEO           │ 0.113432    │ -0.107797   │
│ 94  │ Romeo and Juliet.5.BALTHASAR       │ 0.11334     │ -0.113835   │
│ 95  │ Romeo and Juliet.5.Apothecary      │ 0.186855    │ 0.0334691   │
│ 96  │ Romeo and Juliet.5.FRIAR LAURENCE  │ 0.322517    │ 0.051481    │
│ 97  │ Romeo and Juliet.5.PARIS           │ 0.083704    │ -0.0697151  │
│ 98  │ Romeo and Juliet.5.PAGE            │ 0.0461129   │ -0.016438   │
│ 99  │ Romeo and Juliet.5.JULIET          │ 0.173347    │ -0.0376735  │
│ 100 │ Romeo and Juliet.5.First Watchman  │ 0.138278    │ -0.0692683  │
│ 101 │ Romeo and Juliet.5.Second Watchman │ 0.186855    │ 0.0334691   │
│ 102 │ Romeo and Juliet.5.PRINCE          │ 0.211687    │ -0.0579597  │
│ 103 │ Romeo and Juliet.5.CAPULET         │ 0.141647    │ 0.128884    │
│ 104 │ Romeo and Juliet.5.LADY CAPULET    │ 0.318116    │ 0.0934663   │
│ 105 │ Romeo and Juliet.5.MONTAGUE        │ 0.215514    │ 0.21746     │
Codes:
5×14 DataFrame. Omitted printing of 8 columns
│ Row │ code   │ density  │ pos_x     │ pos_y       │ Death_Honor  │ Death_
Men │
│     │ Symbol │ Float64  │ Float64   │ Float64     │ Real         │ Real  
    │
├─────┼────────┼──────────┼───────────┼─────────────┼──────────────┼───────
────┤
│ 1   │ Love   │ 0.686152 │ -0.400187 │ -0.159577   │ -0.0232083   │ -0.459
782 │
│ 2   │ Death  │ 0.6511   │ 0.472491  │ -0.00613778 │ 0.0724987    │ 0.9501
83  │
│ 3   │ Honor  │ 0.1786   │ -0.150575 │ 0.396461    │ 0.196636     │ 0.0496
659 │
│ 4   │ Men    │ 1.0      │ 0.0634472 │ -0.332354   │ -0.0255981   │ 0.6599
51  │
│ 5   │ Women  │ 0.595926 │ 0.120765  │ 0.0356273   │ -0.000533696 │ -0.510
172 │
Network:
10×6 DataFrame. Omitted printing of 1 columns
│ Row │ relationship │ response │ referent │ density   │ weight_x   │
│     │ Symbol       │ Int64    │ Int64    │ Float64   │ Float64    │
├─────┼──────────────┼──────────┼──────────┼───────────┼────────────┤
│ 1   │ Love_Death   │ 1        │ 2        │ 0.456959  │ -0.126975  │
│ 2   │ Love_Honor   │ 1        │ 3        │ 0.158203  │ 0.0313987  │
│ 3   │ Death_Men    │ 2        │ 4        │ 1.0       │ 0.2707     │
│ 4   │ Men_Women    │ 4        │ 5        │ 0.785616  │ 0.0344896  │
│ 5   │ Love_Women   │ 1        │ 5        │ 0.451214  │ -0.333061  │
│ 6   │ Love_Men     │ 1        │ 4        │ 0.97818   │ -0.0153388 │
│ 7   │ Death_Women  │ 2        │ 5        │ 0.431999  │ 0.532344   │
│ 8   │ Honor_Men    │ 3        │ 4        │ 0.215949  │ -0.484154  │
│ 9   │ Death_Honor  │ 2        │ 3        │ 0.0511535 │ -0.325754  │
│ 10  │ Honor_Women  │ 3        │ 5        │ 0.106877  │ 0.41635    │
signal_to_noise_ratio:
1.6456445495865815

coregistration_y:
0.8117838054881488

variance_x:
0.07168191691101879

variance_y:
0.026222882780896493

correlation_y:
0.8114085744304714

coregistration_x:
0.8302539294056143

correlation_x:
0.8410632419434885

LDA (with subspace adjustment)

These axes are orthogonal.

LDA restricted to subspace of first 4 SVD dimensions.

Note that the coregistrations are higher, (a) variances explained are higher, the X axis still is similar to the X axis from the F1 rotation, and (i-r) all pairs are pulled apart except for 1/2, 1/3, 2/3, and 5/4.

let # create a non-global scope

rotation = LDARotation(:Act)
ena = ENAModel(data, codes, conversations, units, dropEmpty=dropEmpty, sphereNormalize=sphereNormalize, rotateBy=rotation, subspace=4)
p = plot(ena)
display(p)
display(ena)

end # let
Units (centroids):
105×13 DataFrame. Omitted printing of 10 columns
│ Row │ ENA_UNIT                           │ pos_x       │ pos_y      │
│     │ String                             │ Float64     │ Float64    │
├─────┼────────────────────────────────────┼─────────────┼────────────┤
│ 1   │ Hamlet.1.BERNARDO                  │ -0.469824   │ 0.103243   │
│ 2   │ Hamlet.1.HORATIO                   │ -0.231618   │ -0.14144   │
│ 3   │ Hamlet.1.MARCELLUS                 │ -0.30352    │ -0.129557  │
│ 4   │ Hamlet.1.KING CLAUDIUS             │ -0.0589584  │ -0.294179  │
│ 5   │ Hamlet.1.LAERTES                   │ 0.344753    │ 0.275614   │
│ 6   │ Hamlet.1.LORD POLONIUS             │ 0.360517    │ 0.471814   │
│ 7   │ Hamlet.1.HAMLET                    │ -0.21099    │ -0.0458989 │
│ 8   │ Hamlet.1.QUEEN GERTRUDE            │ -0.490364   │ 0.0128189  │
│ 9   │ Hamlet.1.All                       │ 0.371936    │ 0.600606   │
│ 10  │ Hamlet.1.OPHELIA                   │ 0.503479    │ 0.332719   │
│ 11  │ Hamlet.1.Ghost                     │ -0.0809244  │ -0.172114  │
│ 12  │ Hamlet.2.LORD POLONIUS             │ 0.384905    │ -0.0953041 │
│ 13  │ Hamlet.2.OPHELIA                   │ 0.520311    │ -0.174882  │
│ 14  │ Hamlet.2.KING CLAUDIUS             │ 0.368853    │ 0.126002   │
│ 15  │ Hamlet.2.QUEEN GERTRUDE            │ 0.0167084   │ -0.249715  │
│ 16  │ Hamlet.2.ROSENCRANTZ               │ 0.225621    │ 0.125808   │
│ 17  │ Hamlet.2.GUILDENSTERN              │ 0.359497    │ 0.138117   │
│ 18  │ Hamlet.2.HAMLET                    │ 0.353347    │ -0.159414  │
│ 19  │ Hamlet.2.First Player              │ -0.0526658  │ -0.046388  │
│ 20  │ Hamlet.3.KING CLAUDIUS             │ -0.228477   │ -0.100409  │
│ 21  │ Hamlet.3.ROSENCRANTZ               │ 0.335687    │ -0.24827   │
│ 22  │ Hamlet.3.GUILDENSTERN              │ 0.354263    │ -0.0623123 │
│ 23  │ Hamlet.3.QUEEN GERTRUDE            │ 0.4745      │ 0.263966   │
│ 24  │ Hamlet.3.LORD POLONIUS             │ 0.206622    │ -0.0510043 │
│ 25  │ Hamlet.3.OPHELIA                   │ 0.121679    │ 0.011216   │
│ 26  │ Hamlet.3.HAMLET                    │ 0.312733    │ -0.226531  │
│ 27  │ Hamlet.3.First Player              │ 0.299052    │ 0.66112    │
│ 28  │ Hamlet.3.HORATIO                   │ -0.160535   │ -0.188491  │
│ 29  │ Hamlet.3.Player King               │ 0.49978     │ 0.0608567  │
│ 30  │ Hamlet.3.Player Queen              │ 0.399922    │ 0.179704   │
│ 31  │ Hamlet.4.KING CLAUDIUS             │ -0.0939623  │ -0.240765  │
│ 32  │ Hamlet.4.QUEEN GERTRUDE            │ -0.257916   │ 0.103349   │
│ 33  │ Hamlet.4.HAMLET                    │ -0.57478    │ 0.136727   │
│ 34  │ Hamlet.4.ROSENCRANTZ               │ -0.231256   │ -0.225843  │
│ 35  │ Hamlet.4.PRINCE FORTINBRAS         │ 0.0578401   │ -0.220751  │
│ 36  │ Hamlet.4.Captain                   │ -0.160535   │ -0.188491  │
│ 37  │ Hamlet.4.Gentleman                 │ -0.490364   │ 0.0128189  │
│ 38  │ Hamlet.4.HORATIO                   │ -0.490364   │ 0.0128189  │
│ 39  │ Hamlet.4.OPHELIA                   │ -0.226345   │ -0.18196   │
│ 40  │ Hamlet.4.LAERTES                   │ -0.248704   │ -0.237303  │
│ 41  │ Hamlet.4.Servant                   │ -0.490364   │ 0.0128189  │
│ 42  │ Hamlet.4.Messenger                 │ 0.549435    │ -0.127632  │
│ 43  │ Hamlet.5.First Clown               │ -0.521678   │ 0.00372438 │
│ 44  │ Hamlet.5.HAMLET                    │ 0.0499091   │ -0.223602  │
│ 45  │ Hamlet.5.HORATIO                   │ 0.232169    │ -0.200903  │
│ 46  │ Hamlet.5.LAERTES                   │ 0.32383     │ 0.255069   │
│ 47  │ Hamlet.5.First Priest              │ -0.549241   │ 0.420334   │
│ 48  │ Hamlet.5.QUEEN GERTRUDE            │ -0.333506   │ 0.298803   │
│ 49  │ Hamlet.5.KING CLAUDIUS             │ -0.430997   │ -0.089195  │
│ 50  │ Hamlet.5.OSRIC                     │ 0.520311    │ -0.174882  │
│ 51  │ Hamlet.5.Lord                      │ 0.0839104   │ 0.193324   │
│ 52  │ Hamlet.5.PRINCE FORTINBRAS         │ -0.490364   │ 0.0128189  │
│ 53  │ Romeo and Juliet.1.RICHMOND        │ -0.11284    │ 0.0521277  │
│ 54  │ Romeo and Juliet.1.SAMPSON         │ 0.0839104   │ 0.193324   │
│ 55  │ Romeo and Juliet.1.BENVOLIO        │ 0.0759236   │ -0.123165  │
│ 56  │ Romeo and Juliet.1.TYBALT          │ -0.316597   │ 0.488502   │
│ 57  │ Romeo and Juliet.1.CAPULET         │ 0.485816    │ 0.243186   │
│ 58  │ Romeo and Juliet.1.LADY CAPULET    │ 0.577853    │ 0.644985   │
│ 59  │ Romeo and Juliet.1.ROMEO           │ 0.471956    │ -0.220505  │
│ 60  │ Romeo and Juliet.1.PARIS           │ -0.102035   │ 0.578247   │
│ 61  │ Romeo and Juliet.1.Servant         │ 0.381149    │ 0.166078   │
│ 62  │ Romeo and Juliet.1.Nurse           │ 0.473348    │ 0.432974   │
│ 63  │ Romeo and Juliet.1.JULIET          │ 0.520311    │ -0.174882  │
│ 64  │ Romeo and Juliet.1.MERCUTIO        │ 0.319495    │ -0.129578  │
│ 65  │ Romeo and Juliet.1.Second Servant  │ 0.520311    │ -0.174882  │
│ 66  │ Romeo and Juliet.1.Second Capulet  │ 0.0839104   │ 0.193324   │
│ 67  │ Romeo and Juliet.2.Chorus          │ -0.11284    │ 0.0521277  │
│ 68  │ Romeo and Juliet.2.ROMEO           │ 0.268456    │ -0.199857  │
│ 69  │ Romeo and Juliet.2.BENVOLIO        │ 0.493767    │ -0.175361  │
│ 70  │ Romeo and Juliet.2.MERCUTIO        │ 0.191912    │ -0.0890017 │
│ 71  │ Romeo and Juliet.2.JULIET          │ 0.334314    │ -0.150257  │
│ 72  │ Romeo and Juliet.2.Nurse           │ 0.208811    │ 0.00876376 │
│ 73  │ Romeo and Juliet.2.FRIAR LAURENCE  │ -0.0475283  │ -0.143712  │
│ 74  │ Romeo and Juliet.2.PETER           │ 0.520311    │ -0.174882  │
│ 75  │ Romeo and Juliet.2.NURSE           │ 0.0839104   │ 0.193324   │
│ 76  │ Romeo and Juliet.3.BENVOLIO        │ -0.490364   │ 0.0128189  │
│ 77  │ Romeo and Juliet.3.MERCUTIO        │ 0.0167084   │ -0.249715  │
│ 78  │ Romeo and Juliet.3.TYBALT          │ 0.0167084   │ -0.249715  │
│ 79  │ Romeo and Juliet.3.ROMEO           │ 0.0119971   │ -0.115822  │
│ 80  │ Romeo and Juliet.3.LADY CAPULET    │ -0.226391   │ -0.0493785 │
│ 81  │ Romeo and Juliet.3.JULIET          │ -0.0428776  │ -0.111663  │
│ 82  │ Romeo and Juliet.3.Nurse           │ -0.103967   │ -0.0980966 │
│ 83  │ Romeo and Juliet.3.FRIAR LAURENCE  │ -0.134378   │ -0.188312  │
│ 84  │ Romeo and Juliet.3.CAPULET         │ -0.326064   │ 0.0114175  │
│ 85  │ Romeo and Juliet.3.PARIS           │ 0.281907    │ -0.282238  │
│ 86  │ Romeo and Juliet.4.FRIAR LAURENCE  │ -0.185006   │ 0.0240274  │
│ 87  │ Romeo and Juliet.4.PARIS           │ 0.218825    │ -0.162866  │
│ 88  │ Romeo and Juliet.4.JULIET          │ -0.00540515 │ 0.0990324  │
│ 89  │ Romeo and Juliet.4.CAPULET         │ -0.076506   │ -0.251485  │
│ 90  │ Romeo and Juliet.4.Second Servant  │ 0.520311    │ -0.174882  │
│ 91  │ Romeo and Juliet.4.Nurse           │ -0.206766   │ -0.185217  │
│ 92  │ Romeo and Juliet.4.LADY CAPULET    │ -0.739579   │ 0.171166   │
│ 93  │ Romeo and Juliet.5.ROMEO           │ -0.171386   │ -0.243267  │
│ 94  │ Romeo and Juliet.5.BALTHASAR       │ -0.169765   │ -0.236114  │
│ 95  │ Romeo and Juliet.5.Apothecary      │ -0.490364   │ 0.0128189  │
│ 96  │ Romeo and Juliet.5.FRIAR LAURENCE  │ -0.668561   │ 0.124737   │
│ 97  │ Romeo and Juliet.5.PARIS           │ -0.240858   │ -0.246134  │
│ 98  │ Romeo and Juliet.5.PAGE            │ 0.0238473   │ 0.0145279  │
│ 99  │ Romeo and Juliet.5.JULIET          │ -0.334247   │ -0.116404  │
│ 100 │ Romeo and Juliet.5.First Watchman  │ -0.266845   │ -0.148413  │
│ 101 │ Romeo and Juliet.5.Second Watchman │ -0.490364   │ 0.0128189  │
│ 102 │ Romeo and Juliet.5.PRINCE          │ -0.356087   │ -0.0956082 │
│ 103 │ Romeo and Juliet.5.CAPULET         │ -0.232645   │ 0.310611   │
│ 104 │ Romeo and Juliet.5.LADY CAPULET    │ -0.739579   │ 0.171166   │
│ 105 │ Romeo and Juliet.5.MONTAGUE        │ -0.549241   │ 0.420334   │
Codes:
5×14 DataFrame. Omitted printing of 8 columns
│ Row │ code   │ density  │ pos_x     │ pos_y      │ Death_Honor  │ Death_M
en │
│     │ Symbol │ Float64  │ Float64   │ Float64    │ Real         │ Real   
   │
├─────┼────────┼──────────┼───────────┼────────────┼──────────────┼────────
───┤
│ 1   │ Love   │ 0.686152 │ 0.887049  │ -0.46178   │ -0.0232083   │ -0.4597
82 │
│ 2   │ Death  │ 0.6511   │ -1.1343   │ -0.0863775 │ 0.0724987    │ 0.95018
3  │
│ 3   │ Honor  │ 0.1786   │ -0.164747 │ 1.01058    │ 0.196636     │ 0.04966
59 │
│ 4   │ Men    │ 1.0      │ 0.132002  │ -0.540398  │ -0.0255981   │ 0.65995
1  │
│ 5   │ Women  │ 0.595926 │ 0.0142474 │ 0.274633   │ -0.000533696 │ -0.5101
72 │
Network:
10×6 DataFrame. Omitted printing of 1 columns
│ Row │ relationship │ response │ referent │ density   │ weight_x   │
│     │ Symbol       │ Int64    │ Int64    │ Float64   │ Float64    │
├─────┼──────────────┼──────────┼──────────┼───────────┼────────────┤
│ 1   │ Love_Death   │ 1        │ 2        │ 0.456959  │ -0.0547913 │
│ 2   │ Love_Honor   │ 1        │ 3        │ 0.158203  │ 0.065496   │
│ 3   │ Death_Men    │ 2        │ 4        │ 1.0       │ -0.654187  │
│ 4   │ Men_Women    │ 4        │ 5        │ 0.785616  │ 0.0626074  │
│ 5   │ Love_Women   │ 1        │ 5        │ 0.451214  │ 0.0781692  │
│ 6   │ Love_Men     │ 1        │ 4        │ 0.97818   │ 0.66965    │
│ 7   │ Death_Women  │ 2        │ 5        │ 0.431999  │ -0.302206  │
│ 8   │ Honor_Men    │ 3        │ 4        │ 0.215949  │ 0.11124    │
│ 9   │ Death_Honor  │ 2        │ 3        │ 0.0511535 │ -0.0218666 │
│ 10  │ Honor_Women  │ 3        │ 5        │ 0.106877  │ 0.0458891  │
signal_to_noise_ratio:
1.6456445495865815

coregistration_y:
0.9680571617558866

variance_x:
0.26543901033756573

variance_y:
0.10918438785929094

correlation_y:
0.9682435183553564

coregistration_x:
0.9482327257035659

correlation_x:
0.948737945912134

Code Difference Rotation (Honor vs. Death)

Note that this is very similar to the F1 rotation.

let # create a non-global scope

rotation = EpistemicNetworkAnalysis.DifferenceRotation(2, 1)
ena = ENAModel(data, codes, conversations, units, dropEmpty=dropEmpty, sphereNormalize=sphereNormalize, rotateBy=rotation, rotateOn=:codeModel)
p = plot(ena, groupBy=:Act)
display(p)
display(ena)

end # let
Units (centroids):
105×13 DataFrame. Omitted printing of 10 columns
│ Row │ ENA_UNIT                           │ pos_x       │ pos_y       │
│     │ String                             │ Float64     │ Float64     │
├─────┼────────────────────────────────────┼─────────────┼─────────────┤
│ 1   │ Hamlet.1.BERNARDO                  │ 0.557083    │ -0.308962   │
│ 2   │ Hamlet.1.HORATIO                   │ 0.29866     │ -0.24335    │
│ 3   │ Hamlet.1.MARCELLUS                 │ 0.351181    │ -0.370795   │
│ 4   │ Hamlet.1.KING CLAUDIUS             │ 0.0163782   │ -0.337776   │
│ 5   │ Hamlet.1.LAERTES                   │ -0.339955   │ 0.279524    │
│ 6   │ Hamlet.1.LORD POLONIUS             │ -0.271909   │ 0.382904    │
│ 7   │ Hamlet.1.HAMLET                    │ 0.246524    │ -0.272622   │
│ 8   │ Hamlet.1.QUEEN GERTRUDE            │ 0.537342    │ -0.274276   │
│ 9   │ Hamlet.1.All                       │ -0.356914   │ -0.193913   │
│ 10  │ Hamlet.1.OPHELIA                   │ -0.426772   │ 0.171941    │
│ 11  │ Hamlet.1.Ghost                     │ -0.00591917 │ -0.045434   │
│ 12  │ Hamlet.2.LORD POLONIUS             │ -0.326921   │ -0.271917   │
│ 13  │ Hamlet.2.OPHELIA                   │ -0.503961   │ -0.274276   │
│ 14  │ Hamlet.2.KING CLAUDIUS             │ -0.346727   │ -0.075341   │
│ 15  │ Hamlet.2.QUEEN GERTRUDE            │ 0.0248243   │ -0.425192   │
│ 16  │ Hamlet.2.ROSENCRANTZ               │ -0.155116   │ 0.385064    │
│ 17  │ Hamlet.2.GUILDENSTERN              │ -0.251076   │ -0.28693    │
│ 18  │ Hamlet.2.HAMLET                    │ -0.351719   │ 0.0932413   │
│ 19  │ Hamlet.2.First Player              │ 0.0367294   │ 0.0538569   │
│ 20  │ Hamlet.3.KING CLAUDIUS             │ 0.234046    │ 0.171988    │
│ 21  │ Hamlet.3.ROSENCRANTZ               │ -0.307396   │ -0.370795   │
│ 22  │ Hamlet.3.GUILDENSTERN              │ -0.32351    │ 0.307194    │
│ 23  │ Hamlet.3.QUEEN GERTRUDE            │ -0.381014   │ -0.0665764  │
│ 24  │ Hamlet.3.LORD POLONIUS             │ -0.196312   │ 0.428263    │
│ 25  │ Hamlet.3.OPHELIA                   │ -0.0306956  │ 0.0161328   │
│ 26  │ Hamlet.3.HAMLET                    │ -0.332452   │ 0.0732031   │
│ 27  │ Hamlet.3.First Player              │ -0.176426   │ -0.0617748  │
│ 28  │ Hamlet.3.HORATIO                   │ 0.212732    │ -0.150465   │
│ 29  │ Hamlet.3.Player King               │ -0.508594   │ -0.15226    │
│ 30  │ Hamlet.3.Player Queen              │ -0.466096   │ 0.192594    │
│ 31  │ Hamlet.4.KING CLAUDIUS             │ 0.0398408   │ -0.114442   │
│ 32  │ Hamlet.4.QUEEN GERTRUDE            │ 0.206886    │ 0.548501    │
│ 33  │ Hamlet.4.HAMLET                    │ 0.656152    │ -0.244556   │
│ 34  │ Hamlet.4.ROSENCRANTZ               │ 0.257898    │ -0.491609   │
│ 35  │ Hamlet.4.PRINCE FORTINBRAS         │ -0.0098665  │ -0.0397429  │
│ 36  │ Hamlet.4.Captain                   │ 0.212732    │ -0.150465   │
│ 37  │ Hamlet.4.Gentleman                 │ 0.537342    │ -0.274276   │
│ 38  │ Hamlet.4.HORATIO                   │ 0.537342    │ -0.274276   │
│ 39  │ Hamlet.4.OPHELIA                   │ 0.159547    │ -0.208306   │
│ 40  │ Hamlet.4.LAERTES                   │ 0.221864    │ -0.212182   │
│ 41  │ Hamlet.4.Servant                   │ 0.537342    │ -0.274276   │
│ 42  │ Hamlet.4.Messenger                 │ -0.55624    │ 0.312632    │
│ 43  │ Hamlet.5.First Clown               │ 0.56356     │ -0.0927225  │
│ 44  │ Hamlet.5.HAMLET                    │ -0.0492618  │ -0.0102254  │
│ 45  │ Hamlet.5.HORATIO                   │ -0.191033   │ 0.0616234   │
│ 46  │ Hamlet.5.LAERTES                   │ -0.334244   │ 0.146765    │
│ 47  │ Hamlet.5.First Priest              │ 0.483023    │ 0.478749    │
│ 48  │ Hamlet.5.QUEEN GERTRUDE            │ 0.30444     │ 0.721182    │
│ 49  │ Hamlet.5.KING CLAUDIUS             │ 0.404703    │ -0.506629   │
│ 50  │ Hamlet.5.OSRIC                     │ -0.503961   │ -0.274276   │
│ 51  │ Hamlet.5.Lord                      │ -0.0542066  │ 0.593918    │
│ 52  │ Hamlet.5.PRINCE FORTINBRAS         │ 0.537342    │ -0.274276   │
│ 53  │ Romeo and Juliet.1.RICHMOND        │ 0.0332685   │ -0.389445   │
│ 54  │ Romeo and Juliet.1.SAMPSON         │ -0.0542066  │ 0.593918    │
│ 55  │ Romeo and Juliet.1.BENVOLIO        │ -0.183573   │ 0.0803368   │
│ 56  │ Romeo and Juliet.1.TYBALT          │ 0.360207    │ -0.0660111  │
│ 57  │ Romeo and Juliet.1.CAPULET         │ -0.444171   │ 0.406082    │
│ 58  │ Romeo and Juliet.1.LADY CAPULET    │ -0.592301   │ 0.283856    │
│ 59  │ Romeo and Juliet.1.ROMEO           │ -0.530482   │ 0.089495    │
│ 60  │ Romeo and Juliet.1.PARIS           │ 0.211464    │ -0.0525771  │
│ 61  │ Romeo and Juliet.1.Servant         │ -0.431873   │ 0.721182    │
│ 62  │ Romeo and Juliet.1.Nurse           │ -0.510038   │ 0.651772    │
│ 63  │ Romeo and Juliet.1.JULIET          │ -0.503961   │ -0.274276   │
│ 64  │ Romeo and Juliet.1.MERCUTIO        │ -0.43403    │ -0.0546184  │
│ 65  │ Romeo and Juliet.1.Second Servant  │ -0.503961   │ -0.274276   │
│ 66  │ Romeo and Juliet.1.Second Capulet  │ -0.0542066  │ 0.593918    │
│ 67  │ Romeo and Juliet.2.Chorus          │ 0.0332685   │ -0.389445   │
│ 68  │ Romeo and Juliet.2.ROMEO           │ -0.350111   │ 0.0647496   │
│ 69  │ Romeo and Juliet.2.BENVOLIO        │ -0.59192    │ -0.172729   │
│ 70  │ Romeo and Juliet.2.MERCUTIO        │ -0.247398   │ 0.427584    │
│ 71  │ Romeo and Juliet.2.JULIET          │ -0.410793   │ -0.244753   │
│ 72  │ Romeo and Juliet.2.Nurse           │ -0.228301   │ 0.538732    │
│ 73  │ Romeo and Juliet.2.FRIAR LAURENCE  │ -0.0203183  │ 0.118169    │
│ 74  │ Romeo and Juliet.2.PETER           │ -0.503961   │ -0.274276   │
│ 75  │ Romeo and Juliet.2.NURSE           │ -0.0542066  │ 0.593918    │
│ 76  │ Romeo and Juliet.3.BENVOLIO        │ 0.537342    │ -0.274276   │
│ 77  │ Romeo and Juliet.3.MERCUTIO        │ 0.0248243   │ -0.425192   │
│ 78  │ Romeo and Juliet.3.TYBALT          │ 0.0248243   │ -0.425192   │
│ 79  │ Romeo and Juliet.3.ROMEO           │ -0.102295   │ -0.29567    │
│ 80  │ Romeo and Juliet.3.LADY CAPULET    │ 0.143999    │ 0.243964    │
│ 81  │ Romeo and Juliet.3.JULIET          │ -0.00996743 │ 0.0128748   │
│ 82  │ Romeo and Juliet.3.Nurse           │ 0.0889716   │ 0.223341    │
│ 83  │ Romeo and Juliet.3.FRIAR LAURENCE  │ 0.133713    │ -0.147635   │
│ 84  │ Romeo and Juliet.3.CAPULET         │ 0.292798    │ 0.251279    │
│ 85  │ Romeo and Juliet.3.PARIS           │ -0.268648   │ -0.149848   │
│ 86  │ Romeo and Juliet.4.FRIAR LAURENCE  │ 0.13826     │ 0.103744    │
│ 87  │ Romeo and Juliet.4.PARIS           │ -0.305923   │ 0.186102    │
│ 88  │ Romeo and Juliet.4.JULIET          │ -0.0232396  │ -0.13507    │
│ 89  │ Romeo and Juliet.4.CAPULET         │ 0.0119393   │ -0.270992   │
│ 90  │ Romeo and Juliet.4.Second Servant  │ -0.503961   │ -0.274276   │
│ 91  │ Romeo and Juliet.4.Nurse           │ 0.162105    │ -0.0070443  │
│ 92  │ Romeo and Juliet.4.LADY CAPULET    │ 0.722727    │ 0.107277    │
│ 93  │ Romeo and Juliet.5.ROMEO           │ 0.153125    │ -0.159238   │
│ 94  │ Romeo and Juliet.5.BALTHASAR       │ 0.1994      │ -0.189969   │
│ 95  │ Romeo and Juliet.5.Apothecary      │ 0.537342    │ -0.274276   │
│ 96  │ Romeo and Juliet.5.FRIAR LAURENCE  │ 0.635778    │ 0.270793    │
│ 97  │ Romeo and Juliet.5.PARIS           │ 0.248444    │ -0.551921   │
│ 98  │ Romeo and Juliet.5.PAGE            │ -0.0412274  │ 0.395016    │
│ 99  │ Romeo and Juliet.5.JULIET          │ 0.25973     │ -0.00860788 │
│ 100 │ Romeo and Juliet.5.First Watchman  │ 0.319246    │ -0.197431   │
│ 101 │ Romeo and Juliet.5.Second Watchman │ 0.537342    │ -0.274276   │
│ 102 │ Romeo and Juliet.5.PRINCE          │ 0.32579     │ 0.143029    │
│ 103 │ Romeo and Juliet.5.CAPULET         │ 0.146206    │ 0.771798    │
│ 104 │ Romeo and Juliet.5.LADY CAPULET    │ 0.722727    │ 0.107277    │
│ 105 │ Romeo and Juliet.5.MONTAGUE        │ 0.483023    │ 0.478749    │
Codes:
5×14 DataFrame. Omitted printing of 8 columns
│ Row │ code   │ density  │ pos_x      │ pos_y      │ Death_Honor  │ Death_
Men │
│     │ Symbol │ Float64  │ Float64    │ Float64    │ Real         │ Real  
    │
├─────┼────────┼──────────┼────────────┼────────────┼──────────────┼───────
────┤
│ 1   │ Love   │ 0.686152 │ -1.00509   │ -0.479514  │ -0.0232083   │ -0.459
782 │
│ 2   │ Death  │ 0.6511   │ 1.07752    │ -0.479514  │ 0.0724987    │ 0.9501
83  │
│ 3   │ Honor  │ 0.1786   │ 0.297153   │ -0.0884501 │ 0.196636     │ 0.0496
659 │
│ 4   │ Men    │ 1.0      │ 0.00305921 │ -0.249176  │ -0.0255981   │ 0.6599
51  │
│ 5   │ Women  │ 0.595926 │ -0.105578  │ 1.25687    │ -0.000533696 │ -0.510
172 │
Network:
10×6 DataFrame. Omitted printing of 1 columns
│ Row │ relationship │ response │ referent │ density   │ weight_x    │
│     │ Symbol       │ Int64    │ Int64    │ Float64   │ Float64     │
├─────┼──────────────┼──────────┼──────────┼───────────┼─────────────┤
│ 1   │ Love_Death   │ 1        │ 2        │ 0.456959  │ -0.0695424  │
│ 2   │ Love_Honor   │ 1        │ 3        │ 0.158203  │ -0.0404494  │
│ 3   │ Death_Men    │ 2        │ 4        │ 1.0       │ 0.67702     │
│ 4   │ Men_Women    │ 4        │ 5        │ 0.785616  │ -0.0640364  │
│ 5   │ Love_Women   │ 1        │ 5        │ 0.451214  │ -0.233944   │
│ 6   │ Love_Men     │ 1        │ 4        │ 0.97818   │ -0.6164     │
│ 7   │ Death_Women  │ 2        │ 5        │ 0.431999  │ 0.306903    │
│ 8   │ Honor_Men    │ 3        │ 4        │ 0.215949  │ 0.0034169   │
│ 9   │ Death_Honor  │ 2        │ 3        │ 0.0511535 │ 0.0459554   │
│ 10  │ Honor_Women  │ 3        │ 5        │ 0.106877  │ -0.00892289 │
coregistration_y:
0.9593296792738567

variance_x:
0.3240297636922182

variance_y:
0.25730778817302513

correlation_y:
0.9595642725981757

coregistration_x:
0.9607954413263173

correlation_x:
0.9608292163514516